Click here to Skip to main content
15,895,746 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionSource code for SQL database Pin
Ravisubrahmanya12-Nov-09 20:14
Ravisubrahmanya12-Nov-09 20:14 
AnswerRe: Source code for SQL database PinPopular
Johan Hakkesteegt12-Nov-09 20:19
Johan Hakkesteegt12-Nov-09 20:19 
AnswerRe: Source code for SQL database Pin
Shameel12-Nov-09 22:54
professionalShameel12-Nov-09 22:54 
AnswerRe: Source code for SQL database Pin
Dave Kreskowiak13-Nov-09 4:19
mveDave Kreskowiak13-Nov-09 4:19 
AnswerRe: Source code for SQL database Pin
Oakman13-Nov-09 5:45
Oakman13-Nov-09 5:45 
QuestionInterop C++ dll from vb.net Pin
ggoutam712-Nov-09 20:07
ggoutam712-Nov-09 20:07 
AnswerRe: Interop C++ dll from vb.net Pin
Luc Pattyn13-Nov-09 1:11
sitebuilderLuc Pattyn13-Nov-09 1:11 
GeneralRe: Interop C++ dll from vb.net Pin
ggoutam715-Nov-09 21:05
ggoutam715-Nov-09 21:05 
Hello Mr. Luc Pattyn,

Thank you for your prompt reply and interest in this topic.

When I do the testing, I comment out all and test one by one as below. When I can interop every value I need, only then I will put them together :

<br />
typedef struct TEST_STRUCT<br />
{<br />
   //long lTotal;<br />
   //int nRow;<br />
   //int nCol;<br />
   //CString sName;<br />
   //BOOL bFound;<br />
   int item[100];<br />
} TEST;<br />
<br />
<br />
extern "C" __declspec(dllexport) TEST_STRUCT Test123();<br />
<br />
extern "C" __declspec(dllexport) TEST_STRUCT Test123()<br />
{<br />
	//CString sTemp = "You got the CString";<br />
	TEST_STRUCT TestStruct;<br />
<br />
	//TestStruct.lTotal  = 7;<br />
	//TestStruct.nRow  = 20;<br />
	//TestStruct.nCol  = 30;<br />
	//TestStruct.sName  = "You got the CString";<br />
	//TestStruct.bFound  = false;<br />
	TestStruct.item[0] = 11; <br />
<br />
	return TestStruct;<br />
}<br />


1. I agree with you on this.

2. I tried the <MarshalAs(UnmanagedType.ByValArray, SizeConst:=100)>, and it didn't work.
If I declare the bFound as int16 at the vb.net side, then I can get 0 or 1. But that's not what we need.

3. Please enlighten me on the IntPtr and Marshal.PtrToStringXxx methods, as I am still not sure how to use it in this case.

>>4. as long as one struct member isn't marshaled correctly, everything that follows it may fail.
>>so start by putting the string last!
4. I appreciate this advice. I will strictly follow this.

I still could not interop sName, bFound and item[100]. I am getting error message "Method's type signature is not PInvoke compatible."
Any help will be amazing...

cheers,
Goutam
GeneralRe: Interop C++ dll from vb.net Pin
Luc Pattyn16-Nov-09 2:46
sitebuilderLuc Pattyn16-Nov-09 2:46 
GeneralRe: Interop C++ dll from vb.net Pin
ggoutam717-Nov-09 0:04
ggoutam717-Nov-09 0:04 
GeneralRe: Interop C++ dll from vb.net Pin
Luc Pattyn17-Nov-09 1:07
sitebuilderLuc Pattyn17-Nov-09 1:07 
QuestionDelete Empty fields from array ! Pin
jeshra27912-Nov-09 11:46
jeshra27912-Nov-09 11:46 
AnswerRe: Delete Empty fields from array ! Pin
Christian Graus12-Nov-09 13:17
protectorChristian Graus12-Nov-09 13:17 
GeneralRe: Delete Empty fields from array ! Pin
Oakman12-Nov-09 15:31
Oakman12-Nov-09 15:31 
GeneralRe: Delete Empty fields from array ! Pin
EliottA12-Nov-09 15:37
EliottA12-Nov-09 15:37 
GeneralRe: Delete Empty fields from array ! Pin
EliottA12-Nov-09 15:38
EliottA12-Nov-09 15:38 
AnswerRe: Delete Empty fields from array ! [modified] Pin
MikeMarq12-Nov-09 16:47
MikeMarq12-Nov-09 16:47 
QuestionJunior Sql Query Pin
beker_usa12-Nov-09 11:20
beker_usa12-Nov-09 11:20 
AnswerRe: Junior Sql Query Pin
beker_usa12-Nov-09 11:29
beker_usa12-Nov-09 11:29 
GeneralRe: Junior Sql Query Pin
Christian Graus12-Nov-09 13:17
protectorChristian Graus12-Nov-09 13:17 
AnswerRe: Junior Sql Query Pin
Luc Pattyn12-Nov-09 11:59
sitebuilderLuc Pattyn12-Nov-09 11:59 
QuestionSplit string Pin
ivo7512-Nov-09 7:38
ivo7512-Nov-09 7:38 
AnswerRe: Split string Pin
Luc Pattyn12-Nov-09 7:42
sitebuilderLuc Pattyn12-Nov-09 7:42 
GeneralRe: Split string Pin
Christian Graus12-Nov-09 9:33
protectorChristian Graus12-Nov-09 9:33 
GeneralRe: Split string Pin
Luc Pattyn12-Nov-09 10:20
sitebuilderLuc Pattyn12-Nov-09 10:20 

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.