Click here to Skip to main content
15,907,001 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Finding handles to dialogs Pin
mangellj30-Apr-04 3:25
mangellj30-Apr-04 3:25 
GeneralRe: Finding handles to dialogs Pin
V.3-May-04 4:09
professionalV.3-May-04 4:09 
GeneralRe: Finding handles to dialogs Pin
David Crow30-Apr-04 3:30
David Crow30-Apr-04 3:30 
GeneralActive X subclassing Pin
rw10430-Apr-04 0:00
rw10430-Apr-04 0:00 
Generalinterop com client and .net server Pin
mrmgsm29-Apr-04 23:21
mrmgsm29-Apr-04 23:21 
GeneralRe: interop com client and .net server Pin
Mike Dimmick30-Apr-04 2:25
Mike Dimmick30-Apr-04 2:25 
GeneralDLL Help. At the end of my tether! Pin
xsive29-Apr-04 22:59
xsive29-Apr-04 22:59 
GeneralRe: DLL Help. At the end of my tether! Pin
Mike Dimmick30-Apr-04 2:19
Mike Dimmick30-Apr-04 2:19 
OK. Assuming that a Java program can call into a 'flat' DLL (and that's a big assumption from what I've read), you need to do:

File > New > Project

Under Visual C++ Projects > Win32, select Win32 Project. Type a name for the project and hit OK.

In the Win32 Application Wizard dialog, select Application Settings in the left-hand bar, then select DLL under Application Type. Check the 'Export Symbols' checkbox. Hit Finish.

VS.NET generates a project containing five files: stdafx.h, stdafx.cpp, <projectname>.h, <projectname>.cpp and a readme.txt.

The stdafx files are used to produce a precompiled header. This is a binary file used by the compiler to speed up the main compilation by only reading commonly-used header files once. If you're going to use a system header, it's often handy to put the #include statement in stdafx.h.

Let's assume that you called your project NewDll. In newdll.h, VS.NET has generated an exported class, CNewDll, an exported variable, nNewDll, and a function, fnNewDll. To export a function, we want to follow the fnNewDll example; however, to make it easier to import from other languages, it's best to add extern "C" to the beginning of the declaration. This tells the compiler not to 'mangle' the function's name (produce an encoded name that includes all the type information).

If you're using the Microsoft VM for Java, that's probably enough and you need to look up J/Direct. However, the standard mechanism for including C++ code with your Java program is Java Native Interface[^]. You'll have to look up Sun's documentation for this.

Stability. What an interesting concept. -- Chris Maunder
GeneralSize of CRichEditCtrl Pin
GermanGeorge29-Apr-04 22:27
GermanGeorge29-Apr-04 22:27 
GeneralRe: Size of CRichEditCtrl Pin
David Crow30-Apr-04 3:40
David Crow30-Apr-04 3:40 
GeneralRe: Size of CRichEditCtrl Pin
GermanGeorge2-May-04 20:00
GermanGeorge2-May-04 20:00 
GeneralFile Association Pin
Monty229-Apr-04 22:19
Monty229-Apr-04 22:19 
GeneralRe: File Association Pin
Monty230-Apr-04 2:41
Monty230-Apr-04 2:41 
GeneralRe: File Association Pin
David Crow30-Apr-04 3:46
David Crow30-Apr-04 3:46 
GeneralRe: File Association Pin
PJ Arends30-Apr-04 4:19
professionalPJ Arends30-Apr-04 4:19 
GeneralRe: File Association Pin
Monty230-Apr-04 18:38
Monty230-Apr-04 18:38 
GeneralDetecting codecs without DirectShow. Pin
haust29-Apr-04 21:47
haust29-Apr-04 21:47 
GeneralRe: Detecting codecs without DirectShow. Pin
Anthony_Yio29-Apr-04 23:11
Anthony_Yio29-Apr-04 23:11 
GeneralRe: Detecting codecs without DirectShow. Pin
Mike Dimmick30-Apr-04 2:40
Mike Dimmick30-Apr-04 2:40 
GeneralFlood fill of all image objects simultaneously Pin
Kolich29-Apr-04 20:45
Kolich29-Apr-04 20:45 
GeneralRe: Flood fill of all image objects simultaneously Pin
John R. Shaw30-Apr-04 10:55
John R. Shaw30-Apr-04 10:55 
GeneralRe: Flood fill of all image objects simultaneously Pin
Kolich4-May-04 19:11
Kolich4-May-04 19:11 
GeneralRe: Flood fill of all image objects simultaneously Pin
John R. Shaw4-May-04 20:52
John R. Shaw4-May-04 20:52 
GeneralRe: Flood fill of all image objects simultaneously Pin
Kolich4-May-04 22:23
Kolich4-May-04 22:23 
GeneralRe: Flood fill of all image objects simultaneously Pin
John R. Shaw5-May-04 9:03
John R. Shaw5-May-04 9:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.