LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-16-2009, 09:21 AM   #1
redfishrandy
LQ Newbie
 
Registered: Feb 2009
Posts: 4

Rep: Reputation: 0
Help with windows DLL development


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.
 
Old 02-16-2009, 10:40 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
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.
 
Old 02-16-2009, 12:11 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
redfishrandy -

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:

http://www.microsoft.com/Express/
 
Old 02-16-2009, 02:54 PM   #4
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by redfishrandy View Post
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.

Last edited by ErV; 02-16-2009 at 02:55 PM.
 
Old 02-17-2009, 08:09 AM   #5
redfishrandy
LQ Newbie
 
Registered: Feb 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by theYinYeti View Post
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.
 
Old 02-17-2009, 08:30 AM   #6
redfishrandy
LQ Newbie
 
Registered: Feb 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by paulsm4 View Post
redfishrandy -

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:

http://www.microsoft.com/Express/
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.
 
Old 02-17-2009, 08:37 AM   #7
redfishrandy
LQ Newbie
 
Registered: Feb 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ErV View Post
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.
 
Old 02-18-2009, 10:21 AM   #8
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
Quote:
Originally Posted by redfishrandy View Post
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.
Sorry, my mistake… I tend to see posts with “view new posts” and did not pay attention to the forum the post was in…
 
Old 02-18-2009, 10:39 AM   #9
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
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.
 
Old 02-18-2009, 12:04 PM   #10
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
I would highly suggest just using C# - part of the whole design of the implementation of the language was to resolve "DLL hell".
 
Old 02-19-2009, 03:54 AM   #11
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
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.

Yves.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
windows DLL edselrt Linux - Newbie 2 11-07-2005 08:02 PM
How to build a DLL in Windows XP? hoper Programming 2 12-28-2004 08:29 AM
How to build a DLL in Windows XP? hoper General 1 12-28-2004 06:55 AM
Windows DLL to Linux .so mohan_mohan Linux - Software 3 11-04-2004 10:43 AM
is there a way to use windows dll files in c++? bevenl Programming 2 09-30-2004 09:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration