🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
1 messages
1 total messages Started by George Wei Sun, 24 Sep 2000 00:00
What's wrong with the code in my C++ Builder 5 project?
#948
Author: George Wei
Date: Sun, 24 Sep 2000 00:00
73 lines
2607 bytes
I am sorry for that I have to post this message into both the C++ Builder & 
the Delphi groups. I just want more gurus can view this and give me the 
answer.
I have written a Application server by using delphi, and I added a new 
function in it, it declared as:

function VerifyPassword(const Username: WideString; const Password: 
WideString): OleVariant; dispid 1;

And it implemented as:

function TMIDASServer.VerifyPassword(const Username,
  Password: WideString): OleVariant;
var
  S : String;
begin
  if(ADOQuery1.Active=true) then
    ADOQuery1.Close;
  ADOQuery1.Parameters.ParamByName('Username').Value:=UpperCase(Username);
  ADOQuery1.Open;
  S:=ADOQuery1.Fields.FieldByName('PASSWORD').AsString;
  ADOQuery1.Close;
  if(S=String(Password)) then
    result:=S_OK
  else
    result:=E_FAIL;
end;

Then I wrote a client program by using delphi to call this function, just 
like the following:

procedure TForm1.btnVerifyClick(Sender: TObject);
var
  hr : HRESULT;
begin
  DMod1.DCOMConnection1.Connected:=true;
  hr:=DMod1.DCOMConnection1.AppServer.VerifyPassword(edtUsername.Text,edtPa
ssword.Text);
  if(SUCCEEDED(hr)) then
    ShowMessage('Succeeded.')
  else
    ShowMessage('Failed.');
end;

It works OK!
***The real problem is the following:***
Then I wrote a client by using C++ Builder which is similar to the previous 
one. The calling function is implemented as:

void __fastcall TForm1::btnVerifyClick(TObject *Sender)
{
  HRESULT hr;

  DMod1->DCOMConnection1->Connected=true;
  hr=DMod1->DCOMConnection1-
>AppServer.Exec(Function("VerifyPassword")<<WideString(edtUsername->Text)
                                                                      <<Wid
eString(edtPassword->Text));
  if(SUCCEEDED(hr))
    ShowMessage("Succeeded.");
  else
    ShowMessage("Failed.");
}

When I tried to make it, the linker gave the following imformation:

[Linker error] Unresolved external '_Module' referenced from 
D:\BORLAND\CBUILDER5\LIB\BCBATL.LIB|bcbatllib

What's wrong with my code? If you want the source code, please write to me.
Thanks for any help.

George
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads