Click here to Skip to main content
15,924,452 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: copying files using shell Pin
Hesham Amin8-Jan-03 11:21
Hesham Amin8-Jan-03 11:21 
GeneralRe: copying files using shell Pin
iluha8-Jan-03 13:17
iluha8-Jan-03 13:17 
GeneralPrinting in VB.NET Pin
rradhay8-Jan-03 4:19
rradhay8-Jan-03 4:19 
Generaldot syntax and concatenated names Pin
brnwdrng8-Jan-03 3:44
brnwdrng8-Jan-03 3:44 
GeneralRe: dot syntax and concatenated names Pin
FruitBatInShades9-Jan-03 7:13
FruitBatInShades9-Jan-03 7:13 
GeneralRe: dot syntax and concatenated names Pin
brnwdrng9-Jan-03 8:54
brnwdrng9-Jan-03 8:54 
GeneralRe: dot syntax and concatenated names Pin
FruitBatInShades9-Jan-03 10:24
FruitBatInShades9-Jan-03 10:24 
Generalbad dll calling convrention Pin
ns8-Jan-03 2:12
ns8-Jan-03 2:12 
I have in my VB:
Call MyCString(myStringCopy, k, lengthOfStrings)

with:

Dim myStringCopy As String ' no fixed size
Dim k
Dim lengthOfStrings
Dim MyString(0 To 2) As String

    MyString(0) = "a"

    MyString(0) = Left(MyString(0) & String(10, Chr(0)), 10)

 
    MyString(1) = "bbbb "
     MyString(1) = Left(MyString(1) & String(10, Chr(0)), 10)
    MyString(2) = "mmmm"
     MyString(2) = Left(MyString(2) & String(10, Chr(0)), 10)
     
    For i = 0 To 2
    myStringCopy = myStringCopy + MyString(i)
    Next


===========
Public Declare Sub MyCString Lib "MyProj.dll" _
Alias "?MyCString@@YGXPAD@Z" (ByVal ByValString As String, numberOfStrings As Long, lengthOfStrings As Long)
====================
The C dll:

i
nt MakeArray(char* ByValString, int numberOfStrings, int lengthOfStrings, char*** pStringArray)
{
	int i;

	*pStringArray = (char**) malloc(numberOfStrings*sizeof(char*));

	if (!(*pStringArray)) return(1);


	for (i = 0 ; i < numberOfStrings ; i++)
	{
		(*pStringArray)[i] = &(ByValString[lengthOfStrings*i]);
	}


	return(0);
}

__declspec( dllexport ) void MyCString(char * ByValString,int numberOfStrings, int lengthOfStrings)
{
	char** stringArray;

	rtnVal = MakeArray(ByValString, numberOfStrings , lengthOfStrings, &stringArray);
	printf(stringArray[1]);
	free(stringArray);
}

I get bad dll calling convention.
Please help!!

Appreciate your help,
ns
GeneralRe: bad dll calling convrention Pin
geo_m9-Jan-03 8:59
geo_m9-Jan-03 8:59 
GeneralRe: bad dll calling convrention Pin
RichardGrimmer23-Jan-03 4:28
RichardGrimmer23-Jan-03 4:28 
Generalaccessing ini files Pin
r i s h a b h s7-Jan-03 18:28
r i s h a b h s7-Jan-03 18:28 
GeneralRe: accessing ini files Pin
Nick Seng7-Jan-03 20:07
Nick Seng7-Jan-03 20:07 
GeneralRe: accessing ini files Pin
r i s h a b h s7-Jan-03 23:23
r i s h a b h s7-Jan-03 23:23 
GeneralRe: accessing ini files Pin
Jerome Conus7-Jan-03 20:44
Jerome Conus7-Jan-03 20:44 
Generalpadding a string Pin
ns7-Jan-03 8:48
ns7-Jan-03 8:48 
GeneralRe: padding a string Pin
Hesham Amin8-Jan-03 11:28
Hesham Amin8-Jan-03 11:28 
GeneralRe: padding a string Pin
ns9-Jan-03 4:58
ns9-Jan-03 4:58 
Generalpassing a string array to a C dll Pin
ns7-Jan-03 4:21
ns7-Jan-03 4:21 
GeneralRe: passing a string array to a C dll Pin
Nick Parker7-Jan-03 4:58
protectorNick Parker7-Jan-03 4:58 
Questionhow to assign variable Pin
Nashes6-Jan-03 18:46
Nashes6-Jan-03 18:46 
AnswerRe: how to assign variable Pin
Nick Seng7-Jan-03 14:33
Nick Seng7-Jan-03 14:33 
GeneralAlternative to Timer object Pin
Ruca6-Jan-03 5:53
Ruca6-Jan-03 5:53 
GeneralRe: Alternative to Timer object Pin
Richard Deeming6-Jan-03 6:20
mveRichard Deeming6-Jan-03 6:20 
GeneralRe: Alternative to Timer object Pin
Ruca6-Jan-03 6:31
Ruca6-Jan-03 6:31 
GeneralUsing Web Services and XML Pin
Matt Philmon6-Jan-03 5:43
Matt Philmon6-Jan-03 5:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.