Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Fri, 04 Mar 2005 @ 17:58:11 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: CLI with Microsoft .NET
 
From:   Bob Hahn

From someone in Engineering--hope this helps:

I dont use .Net yet but it should be the same in C, C# or VB.

Since the CLI dlls are not .Net the call would have to be from within unmanaged code.

VB (and the other .Net languages) use Unicode for their strings so you would also have to convert the string to an ASCII character array. (In VB6 it was automatically converted to a byte array ... but I dont know if that functionality still exists in VB.Net - probably not.)

     C:
     Int32 EXPENTRY DBCQuery (Int32 SessID, Int32 far *lpReqID, char far
     *lpSQL,
           void far *lpUsing, Int32 UsingLength, void far *lpBuff,
           Int32 far *BuffLen);

     VB6 (untested):
     Declare Function DBCQuery(ByVal SessID As Long, ByRef lpReqID As Long,
     ByVal lpSQL as String,
           ByRef lpUsing As Any, ByVal UsingLength As Long, ByRef lpBuff As Any,
           ByRef BuffLen As Long) as Long

Not having used this I cant be sure about the lpBuff definition since I have no idea what it is for. As defined it would point to (probably) a structure (VB Typedef.)

lpUsing would also probably point to a structure. If the structures contained any strings they would have to be fixed length strings that allowed for one extra byte. (The '/0' char) If they contained pointers you would need to use the Windows API CopyMem() to access the data. (If lpUsing contains only one field value you could change the definition to match that data type. You can also define the function multiple ways - using the Alias clause - if it sometimes needs to be a string and sometimes needs to be a numeric.)

Dont know if this helps much for the base .Net question though.



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020