How to initialize a Structure in VB and how to create an instance of the structure that is creat

Hi.

I have 2 programs which are: a DLL in C and a VB application that uses DLL functions.

Flow: The VB application calls the functions in the C DLL and also VB aplication passes some arguments to the functions of the C DLL.

My Query:

I have a structure whose pointer has to be passed as an argument to the DLL function.How can we initialize a structure in VB.

Is there any way to pass the instance of the structure(for example in C we pass the pointer to the function to access all the members of the structure)

Eagerly waiting for the reply.

Thanks in Advance.

[613 byte] By [satya999] at [2007-12-23]
# 1

Hello
This forum is use to discuss code performance & security using the advanced development tools in VSTS including static and dynamic analysis, code profiling, and unit testing. You should try posting your question to one of the VB forums. http://msdn.microsoft.com/newsgroups/

Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.

BrianCombsMSFT at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

Marshal Class:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemRuntimeInteropServicesMarshalClassTopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemruntimeinteropservicesmarshalclassptrtostructuretopic.asp

Dim typeInfo As UCOMITypeInfo = ...
Dim ptr As IntPtr = IntPtr.Zero
typeInfo.GetTypeAttr(ptr)
Dim attr As TYPEATTR = _
CType(Marshal.PtrToStructure(ptr, GetType(TYPEATTR)), TYPEATTR)

DMan1 at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3

Hi.

I am currently working on VB6.0 and the functions which you have mentioned are for VB .Net.

I request you to guide me in the same.

Thanks in Advance.

satya999 at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
Sorry, but this forum is for VB.NET or VB2005 questions, NOT VB6. If you have such questions there is a post at the top of the forum which has links to various resources here.
SJWhiteley at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic General...