Click here to Skip to main content
16,010,523 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralInvalid Module state in unmanaged DLL Pin
gharrison5-Sep-02 2:44
gharrison5-Sep-02 2:44 
GeneralRe: Invalid Module state in unmanaged DLL Pin
Nish Nishant5-Sep-02 21:57
sitebuilderNish Nishant5-Sep-02 21:57 
GeneralRe: Invalid Module state in unmanaged DLL Pin
imran_rafique6-Sep-02 9:13
imran_rafique6-Sep-02 9:13 
GeneralWindows.h Pin
Paul Ingles4-Sep-02 4:36
Paul Ingles4-Sep-02 4:36 
GeneralRe: Windows.h Pin
Nick Hodapp4-Sep-02 9:55
sitebuilderNick Hodapp4-Sep-02 9:55 
GeneralRe: Windows.h Pin
Paul Ingles4-Sep-02 10:07
Paul Ingles4-Sep-02 10:07 
GeneralManaged ( .net framework ) and unmanaged clash! Pin
Maximilien3-Sep-02 3:53
Maximilien3-Sep-02 3:53 
GeneralRe: Managed ( .net framework ) and unmanaged clash! Pin
Nick Hodapp3-Sep-02 7:28
sitebuilderNick Hodapp3-Sep-02 7:28 
The problem is that windows.h #define's "MessageBox" to be either "MessageBoxA" (ANSI) or "MessabeBoxW" (Unicode). The preprocessor is replacing all instances of "MessageBox" in your code to "MessageBoxA", and of course that is not a valid type in the Forms namespace.

You must #undef MessageBox.

If you intend to use both the Windows MessageBox() and the .NET Framework's MessageBox(), you can get tricky and store the MessageBox macro on the preprocessor's stack:

#pragma push_macro("MessageBox")
#undef MessageBox

...

#pragma pop_macro("MessageBox")


This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2001 Microsoft Corporation. All rights reserved.
GeneralRe: Managed ( .net framework ) and unmanaged clash! Pin
Maximilien3-Sep-02 7:45
Maximilien3-Sep-02 7:45 
GeneralRe: Managed ( .net framework ) and unmanaged clash! Pin
Nick Hodapp3-Sep-02 7:51
sitebuilderNick Hodapp3-Sep-02 7:51 
GeneralRe: Managed ( .net framework ) and unmanaged clash! Pin
Maximilien3-Sep-02 7:51
Maximilien3-Sep-02 7:51 
GeneralRe: Managed ( .net framework ) and unmanaged clash! Pin
Nick Hodapp3-Sep-02 7:58
sitebuilderNick Hodapp3-Sep-02 7:58 
GeneralRe: Managed ( .net framework ) and unmanaged clash! Pin
Stephane Rodriguez.3-Sep-02 19:49
Stephane Rodriguez.3-Sep-02 19:49 
GeneralA question about #define WIN32 and "sbrk" Pin
George Ma1-Sep-02 1:12
George Ma1-Sep-02 1:12 
GeneralRe: A question about #define WIN32 and "sbrk" Pin
Anders Molin1-Sep-02 3:26
professionalAnders Molin1-Sep-02 3:26 
GeneralRe: A question about #define WIN32 and "sbrk" Pin
George Ma1-Sep-02 4:10
George Ma1-Sep-02 4:10 
GeneralA question about "size_t" Pin
George Ma31-Aug-02 21:06
George Ma31-Aug-02 21:06 
GeneralRe: A question about "size_t" Pin
Nish Nishant31-Aug-02 21:31
sitebuilderNish Nishant31-Aug-02 21:31 
GeneralRe: A question about "size_t" Pin
George Ma31-Aug-02 23:46
George Ma31-Aug-02 23:46 
GeneralRe: A question about "size_t" Pin
Nish Nishant1-Sep-02 0:24
sitebuilderNish Nishant1-Sep-02 0:24 
GeneralRe: A question about "size_t" Pin
George Ma1-Sep-02 1:18
George Ma1-Sep-02 1:18 
GeneralFiles and class organizations question. Pin
Maximilien29-Aug-02 12:07
Maximilien29-Aug-02 12:07 
GeneralRe: Files and class organizations question. Pin
Nish Nishant29-Aug-02 15:20
sitebuilderNish Nishant29-Aug-02 15:20 
Generalexception becouse of AfxGetInstanceHandle() Pin
imran_rafique28-Aug-02 11:16
imran_rafique28-Aug-02 11:16 
GeneralRe: exception becouse of AfxGetInstanceHandle() Pin
Nish Nishant28-Aug-02 17:26
sitebuilderNish Nishant28-Aug-02 17:26 

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.