Board index » delphi » DDEInitiate, BSTR using Borland C++ commandline

DDEInitiate, BSTR using Borland C++ commandline

Hi,
     I m not a C Programmer and already spend hours to get this needed
snipet runnig.
Is there someone out there who will get this going ?
      Thanks in advance

#include <exception>
#include <iostream>
#include <string>
#include <io.h>
#include <iostream.h>
#include <conio>
#include "windows.h"
#include "dde.h"
#include "string.h"
#include "ddelib.h"

int Main ()

{

 long Chan;
 BSTR gszApp;
 BSTR gszTopic;
 BSTR gszCommand;

 long __fastcall DDEInitiate(BSTR App, BSTR Topic);
 void __fastcall DDEExecute(long Channel, BSTR Command);
 void __fastcall DDETerminate(long Channel);

 gszApp = "MsAccess";
 gszTopic = "MiV";
 gszCommand = "a2b";

  Chan = DDEInitiate(gszApp, gszTopic);

            DDEExecute(long Chan, BSTR gszCommand);

               DDETerminate(long Chan);

return (0);

Quote
}  /* function WinMain */

 

Re:DDEInitiate, BSTR using Borland C++ commandline


You will find more people familiar with the C++ Builder compiler if you ask
in a newsgroup where that compiler is covered.  This newsgroup is where the
Borland C++ compiler is covered.  The newsgroups for the C++ Builder
compilers have the word 'cppbuilder' in their name.  For instance:

  borland.public.cppbuilder.commandlinetools

.  Ed

Re:DDEInitiate, BSTR using Borland C++ commandline


I'm not sure what u are up to, but here is a bit of crrected code for you:

#include <exception.h>
#include <iostream.h>
#include <string.h>
#include <io.h>
#include <iostream.h>
#include <conio.h>
#include "windows.h"
#include "dde.h"
#include "string.h"
#include "ddelib.h"

//What are these for? Are they already defined in a header?
// Are these already in dde.h?  if so, get rid of them.
long __fastcall DDEInitiate(BSTR App, BSTR Topic);
void __fastcall DDEExecute(long Channel, BSTR Command);
void __fastcall DDETerminate(long Channel);

int Main () {

 long Chan;
 BSTR gszApp;
 BSTR gszTopic;
 BSTR gszCommand;

 gszApp = "MsAccess";
 gszTopic = "MiV";
 gszCommand = "a2b";

 Chan = DDEInitiate(gszApp, gszTopic);
 DDEExecute(Chan, gszCommand);
 DDETerminate(Chan);

return 0;

Quote
}  

Try that, hope it works for you!

Al

Other Threads