Click here to Skip to main content
15,909,518 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
Generalstring formatting to show hex values Pin
richiemac13-May-05 4:20
richiemac13-May-05 4:20 
GeneralRe: string formatting to show hex values Pin
Saksida Bojan17-May-05 3:26
Saksida Bojan17-May-05 3:26 
GeneralRe: string formatting to show hex values Pin
richiemac17-May-05 4:09
richiemac17-May-05 4:09 
GeneralRe: string formatting to show hex values Pin
Saksida Bojan17-May-05 5:01
Saksida Bojan17-May-05 5:01 
GeneralRe: string formatting to show hex values Pin
richiemac18-May-05 0:04
richiemac18-May-05 0:04 
QuestionHow to use unmanaged char arrays as class member? Pin
Thomas Freudenberg12-May-05 3:59
Thomas Freudenberg12-May-05 3:59 
GeneralManaged wrapper and inheritance Pin
Johan de Koning12-May-05 0:00
Johan de Koning12-May-05 0:00 
GeneralNullReferenceException in MC++ Pin
Member 19685839-May-05 11:52
Member 19685839-May-05 11:52 
Hi,

I am new to C++ & MC++. I am trying to write a wrapper class for exsiting code which uses libraries(Adobe Framemaker) to open documents. These libraries are written in C++.

The code is :-

......
public __gc class Framemaker
{

bool ConnectToFrameSession(String* strProgID)
{
char* strProg = (char*)(void*)Marshal::StringToHGlobalAnsi(strProgID);
ConnectToFrame(strProg);

return true;
}
......

int ConnectToFrame(char *strProg)
{
StringT opt_progid;
CLSID pclsid;
LPOLESTR progStr;
HRESULT res;
F_ObjHandleT docId;

// Get the process name.
opt_progid = F_StrCopyString((StringT)strProg);

// Convert the process name into a GUID
progStr = (OLECHAR*)malloc( WBUFLEN*sizeof(wchar_t) );
if(0 == MultiByteToWideChar(CP_ACP, 0, (char *)opt_progid, -1, progStr, WBUFLEN ))
{
fprintf(stderr, "failed to allocate\n");
return(1);
}
.......

Now the code bombs while doing a malloc or calling any native frame functions in the function above. It says Object Not Set or NullRefernecce Exception.

Is it beacuse i am trying to mix managed and unmanaged code?
How shld i go abt solving ths problem ?

Also this code runs fine if i make a console application & run it.
I am trying to make wrapper dll which would be calkled by C#.
Only differnec i see is __GC.

Pls guide me.

Thanks,
Gurminder
GeneralRe: NullReferenceException in MC++ Pin
Anonymous10-May-05 10:05
Anonymous10-May-05 10:05 
GeneralExcellent Question Pin
ursus zeta10-May-05 10:33
ursus zeta10-May-05 10:33 
GeneralRe: Excellent Question Pin
Gurminder_G10-May-05 11:14
sussGurminder_G10-May-05 11:14 
GeneralRe: Excellent Question Pin
ursus zeta12-May-05 9:30
ursus zeta12-May-05 9:30 
GeneralToolboxItem attribute problem Pin
tomand9-May-05 0:17
tomand9-May-05 0:17 
Generalmanaged c++ Pin
_tasleem8-May-05 9:47
_tasleem8-May-05 9:47 
GeneralRe: managed c++ Pin
Christian Graus8-May-05 14:11
protectorChristian Graus8-May-05 14:11 
Generalmystring object help Pin
user3166-May-05 19:24
user3166-May-05 19:24 
GeneralRe: mystring object help Pin
user3166-May-05 19:36
user3166-May-05 19:36 
GeneralPassword Code Pin
Derdog1016-May-05 16:37
Derdog1016-May-05 16:37 
GeneralRe: Password Code Pin
Christian Graus8-May-05 14:13
protectorChristian Graus8-May-05 14:13 
GeneralProtect a file by group Pin
sloaken6-May-05 15:37
sloaken6-May-05 15:37 
GeneralIs there a way to print a String using mc++ Pin
Lagwagon565-May-05 7:25
Lagwagon565-May-05 7:25 
GeneralRe: Is there a way to print a String using mc++ Pin
Christian Graus8-May-05 14:14
protectorChristian Graus8-May-05 14:14 
GeneralC++ Problem Pin
Dohan CRPathirana4-May-05 21:38
sussDohan CRPathirana4-May-05 21:38 
GeneralRe: C++ Problem Pin
ushani5-May-05 18:24
ushani5-May-05 18:24 
GeneralInterop::Excel Pin
Delver4-May-05 9:24
Delver4-May-05 9:24 

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.