Click here to Skip to main content
16,008,719 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: A simpale Question Pin
Luc Pattyn8-Nov-07 3:00
sitebuilderLuc Pattyn8-Nov-07 3:00 
AnswerRe: A simpale Question Pin
MikeMarq8-Nov-07 4:37
MikeMarq8-Nov-07 4:37 
QuestionEPSON Printer Pin
briogene8-Nov-07 2:25
briogene8-Nov-07 2:25 
Questionquestion with chklistbox Pin
eyes20078-Nov-07 1:48
eyes20078-Nov-07 1:48 
AnswerRe: question with chklistbox Pin
AliAmjad8-Nov-07 1:54
AliAmjad8-Nov-07 1:54 
GeneralRe: question with chklistbox Pin
eyes20078-Nov-07 2:16
eyes20078-Nov-07 2:16 
GeneralRe: question with chklistbox Pin
AliAmjad8-Nov-07 2:39
AliAmjad8-Nov-07 2:39 
QuestionPassing pointer to structure from VB.net to VC++ Pin
naaas8-Nov-07 1:19
naaas8-Nov-07 1:19 
Hello

I'm trying to communicate with an application written in C++ that receives windows messages. The problem is that i need to pass a pointer to a structure from VB.

In C++ the code to send a message looks like this (works fine)

BOOL bRC = false;
COPYDATASTRUCT cpd;
cpd.dwData = MESSAGE_1;
cpd.cbData = 0;
cpd.lpData = 0;

bRC = ::SendMessage(m_hServer, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&cpd);


I've tried using marshaling this way in VB but doesn't work:

Dim bo As Boolean
Dim data As CopyData

data.dwData = MESSAGE_1
data.cbData = IntPtr.Zero
data.lpData = IntPtr.Zero

Dim ptr As IntPtr
ptr = Marshal.AllocHGlobal(Marshal.SizeOf(data))
Marshal.StructureToPtr(data, ptr, False)

bo= SendMessage(server, WM_COPYDATA, IntPtr.Zero, ptr)


Any ideas? thank you.
QuestionHow to make the system sleep for a while. Pin
SekharOne7-Nov-07 22:29
SekharOne7-Nov-07 22:29 
AnswerRe: How to make the system sleep for a while. Pin
RichardBerry7-Nov-07 23:55
RichardBerry7-Nov-07 23:55 
QuestionTree view population Pin
briogene7-Nov-07 22:25
briogene7-Nov-07 22:25 
AnswerRe: Tree view population Pin
John_Adams9-Nov-07 23:51
John_Adams9-Nov-07 23:51 
QuestionNetwork/Internet - status - bytes/sent/received Pin
FeRtoll7-Nov-07 22:04
FeRtoll7-Nov-07 22:04 
QuestionRS232 - "Stealth Mode" Pin
RichardBerry7-Nov-07 21:39
RichardBerry7-Nov-07 21:39 
QuestionInvalid StructureMemberDecl Pin
MumbleB7-Nov-07 21:19
MumbleB7-Nov-07 21:19 
AnswerRe: Invalid StructureMemberDecl Pin
AliAmjad7-Nov-07 22:08
AliAmjad7-Nov-07 22:08 
GeneralRe: Invalid StructureMemberDecl Pin
MumbleB8-Nov-07 1:29
MumbleB8-Nov-07 1:29 
QuestionWhy Error Pin
MrFulvio7-Nov-07 20:20
MrFulvio7-Nov-07 20:20 
AnswerRe: Why Error Pin
AliAmjad7-Nov-07 21:57
AliAmjad7-Nov-07 21:57 
GeneralRe: Why Error Pin
MrFulvio7-Nov-07 22:37
MrFulvio7-Nov-07 22:37 
GeneralRe: Why Error Pin
AliAmjad8-Nov-07 1:43
AliAmjad8-Nov-07 1:43 
AnswerRe: Why Error Pin
Luc Pattyn8-Nov-07 1:25
sitebuilderLuc Pattyn8-Nov-07 1:25 
Questionprotection Pin
Ali el7-Nov-07 20:18
Ali el7-Nov-07 20:18 
AnswerRe: protection Pin
AliAmjad7-Nov-07 21:31
AliAmjad7-Nov-07 21:31 
Questionsetting dsn for database Pin
sivaraman_sankaranarayanan7-Nov-07 20:05
sivaraman_sankaranarayanan7-Nov-07 20:05 

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.