Click here to Skip to main content
15,891,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCheckboxes in a CListCtrl Pin
12-Dec-00 3:45
suss12-Dec-00 3:45 
GeneralShell hooks in the absence of Explorer.exe Pin
Ron Russell12-Dec-00 3:37
Ron Russell12-Dec-00 3:37 
GeneralRe: Shell hooks in the absence of Explorer.exe Pin
12-Dec-00 18:19
suss12-Dec-00 18:19 
GeneralCORBA Pin
12-Dec-00 1:54
suss12-Dec-00 1:54 
GeneralFile hiding as in "Magic Folders" Pin
12-Dec-00 0:47
suss12-Dec-00 0:47 
GeneralRe: File hiding as in Pin
Jim Howard12-Dec-00 8:26
Jim Howard12-Dec-00 8:26 
QuestionInserting an ActiveX into a CWebBrowser2 window? Pin
jerry0davis11-Dec-00 23:35
jerry0davis11-Dec-00 23:35 
GeneralVB corrupts arguments when calling C++ DLL function? [Help! I'm falling :] Pin
Brendan Tregear11-Dec-00 17:02
Brendan Tregear11-Dec-00 17:02 
Hi
Well I'm close to insanity so it's time to ask you, the gurus Smile | :)

I've made a DLL in Visual C++ and can successfully call it from within Visual Basic. However, I can't pass function arguments. For instance, one of my functions is:

SetWindowPosition(LONG handle, float width, float height)

Which is declared in VB as:

SetWindowPosition(ByVal handle As Long, ByVal width As Single, ByVal height As Single)

Strangely the last argument is passed correctly, the rest take on erroneous values such as 9.72*e-39. Why would one argument (eg. height) be passed correctly but width is garbage? Guessing it had something to do with the stack, and misaligned arguments (ie 8 byte long reading 4 byte int), I've tried a simple function with just one argument (Single->float as per VB4DLL.txt) but even this produces garbage. With the above function I've also tried converting from Long to long, unsigned int, int, etc. Any ideas?

Regards

Brendan

(For the record I have done the following:
1/ Using a DEF file
EXPORTS
SetWindowPosition //note I don't have @1 is that a problem?
2/ Using extern "C" __declspec(dllexport) before function
3/ no __stdcall statements but it still runs...
GeneralRe: Solution Pin
Brendan Tregear13-Dec-00 12:12
Brendan Tregear13-Dec-00 12:12 
QuestionIs there a way to give focus to your program even when you don't control the program that DOES have focus? Pin
11-Dec-00 16:59
suss11-Dec-00 16:59 
AnswerRe: Is there a way to give focus to your program even when you don't control the program that DOES have focus? Pin
Michael Dunn11-Dec-00 18:43
sitebuilderMichael Dunn11-Dec-00 18:43 
GeneralRe: Is there a way to give focus to your program even when you don't control the program that DOES have focus? Pin
11-Dec-00 21:56
suss11-Dec-00 21:56 
AnswerRe: Is there a way to give focus to your program even when you don't control the program that DOES have focus? Pin
Julien21-Dec-00 14:13
Julien21-Dec-00 14:13 
GeneralModeless dialog box doesn't have focus when created Pin
11-Dec-00 14:26
suss11-Dec-00 14:26 
GeneralRe: Modeless dialog box doesn't have focus when created Pin
Christian Graus11-Dec-00 15:42
protectorChristian Graus11-Dec-00 15:42 
GeneralRe: Modeless dialog box doesn't have focus when created Pin
11-Dec-00 16:57
suss11-Dec-00 16:57 
GeneralRe: Modeless dialog box doesn't have focus when created Pin
Christian Graus12-Dec-00 10:04
protectorChristian Graus12-Dec-00 10:04 
GeneralHandle of edit control Pin
11-Dec-00 10:03
suss11-Dec-00 10:03 
GeneralHandle of edit control Pin
11-Dec-00 10:02
suss11-Dec-00 10:02 
GeneralRe: Handle of edit control Pin
Ancient Dragon11-Dec-00 14:35
Ancient Dragon11-Dec-00 14:35 
GeneralCString and BSTR in WinCE Pin
Mel Stober11-Dec-00 8:53
Mel Stober11-Dec-00 8:53 
GeneralRe: CString and BSTR in WinCE Pin
Erik Funkenbusch11-Dec-00 11:54
Erik Funkenbusch11-Dec-00 11:54 
GeneralThreads Pin
11-Dec-00 6:08
suss11-Dec-00 6:08 
GeneralRe: Threads Pin
Erik Funkenbusch11-Dec-00 12:02
Erik Funkenbusch11-Dec-00 12:02 
GeneralRe: Threads Pin
11-Dec-00 22:13
suss11-Dec-00 22:13 

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.