- HCONV hConv = DdeConnect(DDEIdInst, DDEAtomFromString(server), DDEAtomFromString(topic),
- (PCONVCONTEXT)NULL);
+ HSZ hszServer = DDEAtomFromString(server);
+
+ if ( !hszServer )
+ {
+ return (wxConnectionBase*) NULL;
+ }
+
+
+ HSZ hszTopic = DDEAtomFromString(topic);
+
+ if ( !hszTopic )
+ {
+ DDEFreeString(hszServer);
+ return (wxConnectionBase*) NULL;
+ }
+
+
+ HCONV hConv = ::DdeConnect(DDEIdInst, hszServer, hszTopic,
+ (PCONVCONTEXT) NULL);
+
+ DDEFreeString(hszServer);
+ DDEFreeString(hszTopic);
+
+