ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to write a Windows DLL for some application (stock trading) s/w that I use frequently. I have programming experience and I also have a detailed example of another DLL (source code, header files, etc.) supplied by the s/w vendor. The example provided is an intraprocess DLL that communicates between various windows within the application. I want my DLL to operate outside the application (read a keyboard character) and pass it to the application. It looks fairly straightforward. Here is what I am planning to do:
1. Go grab a windows C/C++ compiler.
2. Tear out of the example DLL only the functionality I need for my app.
3. Code the C/C++ keyboard input stuff.
4. Compile, link, etc.
I am sure there are plenty of pitfalls along the way. Bearing in mind this is a small project, any suggestions here about compilers (free) or tips for writing DLL's or relevant websites, etc. will be appreciated.
Errr… Linux site here… Well, let's be helpful anyway…
DLL files exist in two flavours: Win32 and .NET. For the former, you'll rather use the Wine environment (more of a workaround for not having the real thing…), while for the latter (.NET), you'll rather use the Mono platform (a valid development platform even on Linux).
Buy a book and code a Windows (or .Net) "hello world" before you start getting too ambitious. I think you'll probably want to scale back on the scope of your project, and focus on the "value added" you bring (rather than "implementation details" like where keystrokes come from or how processes communicate with each other).
Also: I think what you're really after is building a "component" (which may - or may not - be implemented as a "dll").
Strong suggestion: download one of Microsoft's(free! as in beer) Visual Studio Express Editions. I prefer C#, but you might also be interested in VB.Net:
1. Go grab a windows C/C++ compiler.
2. Tear out of the example DLL only the functionality I need for my app.
3. Code the C/C++ keyboard input stuff.
4. Compile, link, etc.
You missed "write code, debug and wonder why it doesn't work" step which will take most of your time.
Free compilers:
mingw (www.mingw.org), "Visual Studio COmpiler Toolkit" and Microsoft Visual studio express. Before doing something like that I recommend to have at least several months of C/C++ experience, and you should be familiar with developing dlls.
Tutorials on writing DLLs can be found in books, on msdn, etc.
You give too little info, and there are too many possible pitfalls to recommend you something specific.
Errr… Linux site here… Well, let's be helpful anyway…
DLL files exist in two flavours: Win32 and .NET. For the former, you'll rather use the Wine environment (more of a workaround for not having the real thing…), while for the latter (.NET), you'll rather use the Mono platform (a valid development platform even on Linux).
Yves.
Hmmm. I guess I mistook the "Non-*NIX" forum category to be a Non-UNIX or NON-LINUX forum. My mistake. Thanks for the feedback.
Buy a book and code a Windows (or .Net) "hello world" before you start getting too ambitious. I think you'll probably want to scale back on the scope of your project, and focus on the "value added" you bring (rather than "implementation details" like where keystrokes come from or how processes communicate with each other).
Also: I think what you're really after is building a "component" (which may - or may not - be implemented as a "dll").
Strong suggestion: download one of Microsoft's(free! as in beer) Visual Studio Express Editions. I prefer C#, but you might also be interested in VB.Net:
Thanks for the feedback. I guess I don't know how to scale back the project. All I really need is a signal from the outside world to my application software to tell it to "go!". The platform is Tradestation (stock broker) and the language is their proprietary EasyLanguage software. Right now I have to initiate my discretionary trading strategies using a process of about 3 open dialog box actions and about 6 keystrokes. It would make my life much easier, as I am a frequent trader, to just have to press one key to initiate my s/w which is internal to Tradestation. Tradestation facilitates anything above and beyond what they provide functionality-wise through the use of DLLs. I have programming experience in C/C++ so I think I should be able to make this thing work. But as one of my bosses in a previous life said - "you ain't a programmer - you're a hacker".
Thanks for the Visual Studio Express tip - I'll go look at that stuff.
You missed "write code, debug and wonder why it doesn't work" step which will take most of your time.
Yeah, I typically spend most of my time in the "wonder why it doesn't work" loop. It is from that place that I am roused, occasionally, to feed the kids, pay the bills, and let the dog out to pee.
Thanks for the compiler link and the advice.
I see no problem with helping someone with a Windows programming question...if I can of course.
Yes, the free Visual Express modules are the best way for you to go, I think. I am not sure that you can build a dll with one of those; I *think* that is a functionality that M$ wants you to pay for. I am not sure of that, however.
I often use mingw myself, and mostly I use it as a cross-compiler, compiling a Windows executable in a Linux environment. I have found that there are a LOT of pitfalls in mingw when building DLLs, though mostly these have to do with making Linux .so code accessible as a DLL.
Still, if cross-platform execution matters to you, I suggest you have a look at Mono and the free tools that exist for it.
Unlike Wine, Mono is not a “toy-project”, it is stable, and even supported by Microsoft to some degree. And it is compatible with MS .NET.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.