Board index » cppbuilder » New problem

New problem


2004-01-05 10:09:50 AM
cppbuilder1
I guess I don't remember how to call a Pascal function after all. I get an
unresolved external '__Stdcall RtfToHtml(System::AnsiString) referenced....
I tried this it in my h file and my cpp file but either way I declared it as
such:
extern pascal AnsiString RtfToHtml(AnsiString textstuff);
my code looks like this where I call it. It's been changed trying to get
around errors. Previously Memo1->Lines->Text replaced HTMLString. And
HTMLString is of type AnsiString.
HTMLString = RtfToHtml(RichEdit1->Lines->Text);
Memo1->Lines->Text = HTMLString;
Memo1->Lines->SaveToFile(FileName);
I added Rtf2Html.pas to my project.
I've never tried to call a Pascal function from c before. I was taught how
around 94 or 95 so it's been a while. Does it show? ;)
 
 

Re:New problem

"Gary" < XXXX@XXXXX.COM >wrote in message
Quote
I guess I don't remember how to call a Pascal function after all.
When you say "Pascal", are you referring to a function that is actually
written in the Delphi Pascal language? Or just a C++ function that uses the
__pascal calling convention? They are very different things. You need to
clearify exactly what you are trying to accomplish.
Gambit
P.S. when you start discussing a new topic, you should start a new thread
for it.
 

Re:New problem

It's written in actual Pascal. Somewhere on the ngs, someone was pointed to
this function when they wanted HTML from a RichEdit and I downloaded it too
because I wanted to have HTML from a RichEdit as well.
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Gary" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>I guess I don't remember how to call a Pascal function after all.

When you say "Pascal", are you referring to a function that is actually
written in the Delphi Pascal language? Or just a C++ function that uses
the
__pascal calling convention? They are very different things. You need to
clearify exactly what you are trying to accomplish.


Gambit

P.S. when you start discussing a new topic, you should start a new thread
for it.


 

{smallsort}

Re:New problem

"Gary" < XXXX@XXXXX.COM >wrote in message
Quote
It's written in actual Pascal.
I assume that the Pascal is being added to the C++ project directly,
correct? If so, then simply put the code into its own .PAS unit (if it is
not already) and add that unit to the project. The IDE will automatically
produce an .HPP header file for your C++ code to use to access the Pascal
functions/classes/varaibles.
Gambit
 

Re:New problem

Thank you! :D