Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

RAPI Problems!

tonengtoneng Member Posts: 4
Huomenta!

I have a problem with RAPI in Delphi. I made a program in
Delphi that should detect if Pocket PC is connected. Evrithing
else is working fine exept CeRapiUnInit.I am using Rapi.pas
from borland examples.
The call: @mCeRapiUnInit:= GetProcAddress(RapiModule, 'CeRapiUnInit');
is returning "Inaccessible value", that is propably meaning nil. I am using Delphi 4 and ActiveSync 3.8.
When I was looking closer the CeRapiInit has the same problem but the CeRapiInitEx is working.

How can I get it to work?

Is there any simpler ways to detect if Pocket PC is connected in Delphi?

Comments

  • zibadianzibadian Member Posts: 6,349
    : Huomenta!
    :
    : I have a problem with RAPI in Delphi. I made a program in
    : Delphi that should detect if Pocket PC is connected. Evrithing
    : else is working fine exept CeRapiUnInit.I am using Rapi.pas
    : from borland examples.
    : The call: @mCeRapiUnInit:= GetProcAddress(RapiModule, 'CeRapiUnInit');
    : is returning "Inaccessible value", that is propably meaning nil. I am using Delphi 4 and ActiveSync 3.8.
    : When I was looking closer the CeRapiInit has the same problem but the CeRapiInitEx is working.
    :
    : How can I get it to work?
    :
    : Is there any simpler ways to detect if Pocket PC is connected in Delphi?
    :
    :
    How did you declare the variable mCeRapiUnInit? If you declared it in the following way (example):
    [code]
    type
    TmCeRapiUnInit = procedure();
    var
    mCeRapiUnInit: TmCeRapiUnInit;
    [/code]
    then the GetProcAddress() line should be:
    [code]
    mCeRapiUnInit := TmCeRapiUnInit(GetProcAddress(RapiModule, 'CeRapiUnInit'));
    [/code]
  • tonengtoneng Member Posts: 4
    : : Huomenta!
    : :
    : : I have a problem with RAPI in Delphi. I made a program in
    : : Delphi that should detect if Pocket PC is connected. Evrithing
    : : else is working fine exept CeRapiUnInit.I am using Rapi.pas
    : : from borland examples.
    : : The call: @mCeRapiUnInit:= GetProcAddress(RapiModule, 'CeRapiUnInit');
    : : is returning "Inaccessible value", that is propably meaning nil. I am using Delphi 4 and ActiveSync 3.8.
    : : When I was looking closer the CeRapiInit has the same problem but the CeRapiInitEx is working.
    : :
    : : How can I get it to work?
    : :
    : : Is there any simpler ways to detect if Pocket PC is connected in Delphi?
    : :
    : :
    : How did you declare the variable mCeRapiUnInit? If you declared it in the following way (example):
    : [code]
    : type
    : TmCeRapiUnInit = procedure();
    : var
    : mCeRapiUnInit: TmCeRapiUnInit;
    : [/code]
    : then the GetProcAddress() line should be:
    : [code]
    : mCeRapiUnInit := TmCeRapiUnInit(GetProcAddress(RapiModule, 'CeRapiUnInit'));
    : [/code]
    :

    It is declared like this:
    [code]
    TCeRapiUnInit = function : LongInt stdcall;
    var mCeRapiUnInit : TCeRapiUnInit;
    [/code]
  • zibadianzibadian Member Posts: 6,349
    : : : Huomenta!
    : : :
    : : : I have a problem with RAPI in Delphi. I made a program in
    : : : Delphi that should detect if Pocket PC is connected. Evrithing
    : : : else is working fine exept CeRapiUnInit.I am using Rapi.pas
    : : : from borland examples.
    : : : The call: @mCeRapiUnInit:= GetProcAddress(RapiModule, 'CeRapiUnInit');
    : : : is returning "Inaccessible value", that is propably meaning nil. I am using Delphi 4 and ActiveSync 3.8.
    : : : When I was looking closer the CeRapiInit has the same problem but the CeRapiInitEx is working.
    : : :
    : : : How can I get it to work?
    : : :
    : : : Is there any simpler ways to detect if Pocket PC is connected in Delphi?
    : : :
    : : :
    : : How did you declare the variable mCeRapiUnInit? If you declared it in the following way (example):
    : : [code]
    : : type
    : : TmCeRapiUnInit = procedure();
    : : var
    : : mCeRapiUnInit: TmCeRapiUnInit;
    : : [/code]
    : : then the GetProcAddress() line should be:
    : : [code]
    : : mCeRapiUnInit := TmCeRapiUnInit(GetProcAddress(RapiModule, 'CeRapiUnInit'));
    : : [/code]
    : :
    :
    : It is declared like this:
    : [code]
    : TCeRapiUnInit = function : LongInt stdcall;
    : var mCeRapiUnInit : TCeRapiUnInit;
    : [/code]
    :
    Then the following statement should work:
    [code]
    mCeRapiUnInit := TCeRapiUnInit(GetProcAddress(RapiModule, 'CeRapiUnInit'));
    [/code]
    Provided the RapiModule has a valid value, and CeRapiUnInit is exported by that library.
  • tonengtoneng Member Posts: 4
    : : : : Huomenta!
    : : : :
    : : : : I have a problem with RAPI in Delphi. I made a program in
    : : : : Delphi that should detect if Pocket PC is connected. Evrithing
    : : : : else is working fine exept CeRapiUnInit.I am using Rapi.pas
    : : : : from borland examples.
    : : : : The call: @mCeRapiUnInit:= GetProcAddress(RapiModule, 'CeRapiUnInit');
    : : : : is returning "Inaccessible value", that is propably meaning nil. I am using Delphi 4 and ActiveSync 3.8.
    : : : : When I was looking closer the CeRapiInit has the same problem but the CeRapiInitEx is working.
    : : : :
    : : : : How can I get it to work?
    : : : :
    : : : : Is there any simpler ways to detect if Pocket PC is connected in Delphi?
    : : : :
    : : : :
    : : : How did you declare the variable mCeRapiUnInit? If you declared it in the following way (example):
    : : : [code]
    : : : type
    : : : TmCeRapiUnInit = procedure();
    : : : var
    : : : mCeRapiUnInit: TmCeRapiUnInit;
    : : : [/code]
    : : : then the GetProcAddress() line should be:
    : : : [code]
    : : : mCeRapiUnInit := TmCeRapiUnInit(GetProcAddress(RapiModule, 'CeRapiUnInit'));
    : : : [/code]
    : : :
    : :
    : : It is declared like this:
    : : [code]
    : : TCeRapiUnInit = function : LongInt stdcall;
    : : var mCeRapiUnInit : TCeRapiUnInit;
    : : [/code]
    : :
    : Then the following statement should work:
    : [code]
    : mCeRapiUnInit := TCeRapiUnInit(GetProcAddress(RapiModule, 'CeRapiUnInit'));
    : [/code]
    : Provided the RapiModule has a valid value, and CeRapiUnInit is exported by that library.
    :
    Thanks for the reply!
    No it is not working, here is the code for CeRapiUnInit:
    [code]
    TCeRapiUnInit = function: LongInt stdcall;

    function CeRapiUnInit: LongInt;

    var
    mCeRapiUnInit: TCeRapiUnInit;
    RapiModule: THandle;

    RapiModule := LoadLibrary('RAPI.DLL');

    @mCeRapiUnInit:= GetProcAddress(RapiModule, 'CeRapiUnInit');

    function CeRapiUnInit: THandle;
    begin
    if not RapiLoaded then begin
    Result := $FFFF;
    Exit;
    end;

    if @mCeRapiUnInit <> nil then
    Result := mCeRapiUnInit
    else
    Result := $FFFF;
    end;
    [/code]
    What i understan, @mCeRapiUnInit should get the pointer to RAPI.DLL CeRapiUnInit module, but gets "Inaccessible value".
    The code is from this site if someone is intrested: http://www.pocketpcfaq.com/developer/faq/RAPI.html

    Evrything else is working fine exept CeRapiInit and CeRapiUnInit!
    Can I change some configurations in my Delphi 4 to get it to work?
  • zibadianzibadian Member Posts: 6,349
    : : : : : Huomenta!
    : : : : :
    : : : : : I have a problem with RAPI in Delphi. I made a program in
    : : : : : Delphi that should detect if Pocket PC is connected. Evrithing
    : : : : : else is working fine exept CeRapiUnInit.I am using Rapi.pas
    : : : : : from borland examples.
    : : : : : The call: @mCeRapiUnInit:= GetProcAddress(RapiModule, 'CeRapiUnInit');
    : : : : : is returning "Inaccessible value", that is propably meaning nil. I am using Delphi 4 and ActiveSync 3.8.
    : : : : : When I was looking closer the CeRapiInit has the same problem but the CeRapiInitEx is working.
    : : : : :
    : : : : : How can I get it to work?
    : : : : :
    : : : : : Is there any simpler ways to detect if Pocket PC is connected in Delphi?
    : : : : :
    : : : : :
    : : : : How did you declare the variable mCeRapiUnInit? If you declared it in the following way (example):
    : : : : [code]
    : : : : type
    : : : : TmCeRapiUnInit = procedure();
    : : : : var
    : : : : mCeRapiUnInit: TmCeRapiUnInit;
    : : : : [/code]
    : : : : then the GetProcAddress() line should be:
    : : : : [code]
    : : : : mCeRapiUnInit := TmCeRapiUnInit(GetProcAddress(RapiModule, 'CeRapiUnInit'));
    : : : : [/code]
    : : : :
    : : :
    : : : It is declared like this:
    : : : [code]
    : : : TCeRapiUnInit = function : LongInt stdcall;
    : : : var mCeRapiUnInit : TCeRapiUnInit;
    : : : [/code]
    : : :
    : : Then the following statement should work:
    : : [code]
    : : mCeRapiUnInit := TCeRapiUnInit(GetProcAddress(RapiModule, 'CeRapiUnInit'));
    : : [/code]
    : : Provided the RapiModule has a valid value, and CeRapiUnInit is exported by that library.
    : :
    : Thanks for the reply!
    : No it is not working, here is the code for CeRapiUnInit:
    : [code]
    : TCeRapiUnInit = function: LongInt stdcall;
    :
    : function CeRapiUnInit: LongInt;
    :
    : var
    : mCeRapiUnInit: TCeRapiUnInit;
    : RapiModule: THandle;
    :
    : RapiModule := LoadLibrary('RAPI.DLL');
    :
    : [red]mCeRapiUnInit:= TCeRapiUnInit(GetProcAddress(RapiModule, 'CeRapiUnInit'));[/red]
    :
    : function CeRapiUnInit: THandle;
    : begin
    : if not RapiLoaded then begin
    : Result := $FFFF;
    : Exit;
    : end;
    :
    : if @mCeRapiUnInit <> nil then
    : Result := mCeRapiUnInit
    : else
    : Result := $FFFF;
    : end;
    : [/code]
    : What i understan, @mCeRapiUnInit should get the pointer to RAPI.DLL CeRapiUnInit module, but gets "Inaccessible value".
    : The code is from this site if someone is intrested: http://www.pocketpcfaq.com/developer/faq/RAPI.html
    :
    : Evrything else is working fine exept CeRapiInit and CeRapiUnInit!
    : Can I change some configurations in my Delphi 4 to get it to work?
    :
    I've had lots of successes with the method I told you. I've changed your code above (in red) to the way I use. Try that instead of the @ symbol.
  • tonengtoneng Member Posts: 4
    : : : : : : Huomenta!
    : : : : : :
    : : : : : : I have a problem with RAPI in Delphi. I made a program in
    : : : : : : Delphi that should detect if Pocket PC is connected. Evrithing
    : : : : : : else is working fine exept CeRapiUnInit.I am using Rapi.pas
    : : : : : : from borland examples.
    : : : : : : The call: @mCeRapiUnInit:= GetProcAddress(RapiModule, 'CeRapiUnInit');
    : : : : : : is returning "Inaccessible value", that is propably meaning nil. I am using Delphi 4 and ActiveSync 3.8.
    : : : : : : When I was looking closer the CeRapiInit has the same problem but the CeRapiInitEx is working.
    : : : : : :
    : : : : : : How can I get it to work?
    : : : : : :
    : : : : : : Is there any simpler ways to detect if Pocket PC is connected in Delphi?
    : : : : : :
    : : : : : :
    : : : : : How did you declare the variable mCeRapiUnInit? If you declared it in the following way (example):
    : : : : : [code]
    : : : : : type
    : : : : : TmCeRapiUnInit = procedure();
    : : : : : var
    : : : : : mCeRapiUnInit: TmCeRapiUnInit;
    : : : : : [/code]
    : : : : : then the GetProcAddress() line should be:
    : : : : : [code]
    : : : : : mCeRapiUnInit := TmCeRapiUnInit(GetProcAddress(RapiModule, 'CeRapiUnInit'));
    : : : : : [/code]
    : : : : :
    : : : :
    : : : : It is declared like this:
    : : : : [code]
    : : : : TCeRapiUnInit = function : LongInt stdcall;
    : : : : var mCeRapiUnInit : TCeRapiUnInit;
    : : : : [/code]
    : : : :
    : : : Then the following statement should work:
    : : : [code]
    : : : mCeRapiUnInit := TCeRapiUnInit(GetProcAddress(RapiModule, 'CeRapiUnInit'));
    : : : [/code]
    : : : Provided the RapiModule has a valid value, and CeRapiUnInit is exported by that library.
    : : :
    : : Thanks for the reply!
    : : No it is not working, here is the code for CeRapiUnInit:
    : : [code]
    : : TCeRapiUnInit = function: LongInt stdcall;
    : :
    : : function CeRapiUnInit: LongInt;
    : :
    : : var
    : : mCeRapiUnInit: TCeRapiUnInit;
    : : RapiModule: THandle;
    : :
    : : RapiModule := LoadLibrary('RAPI.DLL');
    : :
    : : [red]mCeRapiUnInit:= TCeRapiUnInit(GetProcAddress(RapiModule, 'CeRapiUnInit'));[/red]
    : :
    : : function CeRapiUnInit: THandle;
    : : begin
    : : if not RapiLoaded then begin
    : : Result := $FFFF;
    : : Exit;
    : : end;
    : :
    : : if @mCeRapiUnInit <> nil then
    : : Result := mCeRapiUnInit
    : : else
    : : Result := $FFFF;
    : : end;
    : : [/code]
    : : What i understan, @mCeRapiUnInit should get the pointer to RAPI.DLL CeRapiUnInit module, but gets "Inaccessible value".
    : : The code is from this site if someone is intrested: http://www.pocketpcfaq.com/developer/faq/RAPI.html
    : :
    : : Evrything else is working fine exept CeRapiInit and CeRapiUnInit!
    : : Can I change some configurations in my Delphi 4 to get it to work?
    : :
    : I've had lots of successes with the method I told you. I've changed your code above (in red) to the way I use. Try that instead of the @ symbol.
    :

    No, no response.

Sign In or Register to comment.