dbServer access in Bandol RC 2 & some other issues
Posted: Mon Jun 17, 2019 3:46 pm
Hello Chris, Robert,
Thanks for the explanation and the workarounds. However, adding the code like this (with or without semicolon) :
cConn:=CurDrive() + ":" + CurDir()
[DllImport("ace32.dll", CharSet := CharSet.Ansi)];
If lRemoteADS
ulRetVal:=AdsConnect60(cConn ,XSharp.ADS.ACE.ADS_REMOTE_SERVER, "adssys", Null, (Dword)XSharp.ADS.ACE.ADS_DEFAULT, hConn)
gives these 4 errors on the same line (the one in bold, with ADSConnect60 in it):
Error XS9002 Parser: mismatched input '(' expecting EOS (2X)
Error XS9002 Parser: unexpected CRLF, are you missing a token ?
Error XS9002 Parser: unexpected input 'CharSet.Ansi)'
Then I thought I should probably move it at the start of the containing method like with [System.Diagnostics.DebuggerHidden()] but when I do that it gives:
Error XS0601 The DllImport attribute must be specified on a method marked 'static' and 'extern'
The method is currently a Public Virtual Method and although I usually don't have specific reasons to make a method anything special (like in VO where a METHOD is simply a METHOD everywhere in my programs) some method types in X#/Vulcan have been chosen after some of the other ways failed. Which proves because when I make the method STATIC EXTERN as the error suggests I should do I get XS0179 'Method' cannot be extern and declare a body.
In short, I don't want to change my method type from 'working' to 'possible not working'.
I also tried including ADS.PRG which gives over 300 errors in the #region Constructor. When I remove the entire region only the above errors remain. Also I noticed that in ADS.PRG
PUBLIC STATIC METHOD AdsConnect60(strServerPath as string , usServerTypes as WORD, strUserName as string , strPassword as string , ulOptions as DWORD, phConnect out IntPtr ) as DWORD
is outcommented under // Unused methods. Is that correct?
Is it probably better to wait until the missing parts are added without the need to change my code further? Or would you like me to test the actual program with additional info how to deal with these new errors?
Dick
Thanks for the explanation and the workarounds. However, adding the code like this (with or without semicolon) :
cConn:=CurDrive() + ":" + CurDir()
[DllImport("ace32.dll", CharSet := CharSet.Ansi)];
If lRemoteADS
ulRetVal:=AdsConnect60(cConn ,XSharp.ADS.ACE.ADS_REMOTE_SERVER, "adssys", Null, (Dword)XSharp.ADS.ACE.ADS_DEFAULT, hConn)
gives these 4 errors on the same line (the one in bold, with ADSConnect60 in it):
Error XS9002 Parser: mismatched input '(' expecting EOS (2X)
Error XS9002 Parser: unexpected CRLF, are you missing a token ?
Error XS9002 Parser: unexpected input 'CharSet.Ansi)'
Then I thought I should probably move it at the start of the containing method like with [System.Diagnostics.DebuggerHidden()] but when I do that it gives:
Error XS0601 The DllImport attribute must be specified on a method marked 'static' and 'extern'
The method is currently a Public Virtual Method and although I usually don't have specific reasons to make a method anything special (like in VO where a METHOD is simply a METHOD everywhere in my programs) some method types in X#/Vulcan have been chosen after some of the other ways failed. Which proves because when I make the method STATIC EXTERN as the error suggests I should do I get XS0179 'Method' cannot be extern and declare a body.
In short, I don't want to change my method type from 'working' to 'possible not working'.
I also tried including ADS.PRG which gives over 300 errors in the #region Constructor. When I remove the entire region only the above errors remain. Also I noticed that in ADS.PRG
PUBLIC STATIC METHOD AdsConnect60(strServerPath as string , usServerTypes as WORD, strUserName as string , strPassword as string , ulOptions as DWORD, phConnect out IntPtr ) as DWORD
is outcommented under // Unused methods. Is that correct?
Is it probably better to wait until the missing parts are added without the need to change my code further? Or would you like me to test the actual program with additional info how to deal with these new errors?
Dick