PC Review


Reply
Thread Tools Rate Thread

How to access a pointer to an existing structure?

 
 
Sujoan
Guest
Posts: n/a
 
      1st Apr 2006
Hi,
Iam trying to implement the QueryStatus method of IOleCommandTarget
interface.
public int QueryStatus(ref Guid pguidCmdGroup, int cCmds, IntPtr
prgCmds, IntPtr pCmdText)
{
object ocmd=Marshal.PtrToStructure(prgCmds,typeof(OLECMD));

}
Basically, prgCmds is a pointer to an existing OLECMD structure, and I
want to fill in that structure. I tried to use Marshal.PtrToStructure
to obtain the structure. But it returns an object.The structure
definition of OLECMD is as follows:
[StructLayout(LayoutKind.Sequential)]
public struct OLECMD
{
public UInt32 cmdID;
public UInt64 cmdf;
}
I want to set the value of cmdf. How to do it?Please somebody help me
in this regard.

Thanks in advance,
Sujoan.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Void pointer and structure pointer Nasif Microsoft C# .NET 3 20th Jun 2008 06:55 PM
How to access a pointer to an existing structure? Sujoan Microsoft C# .NET 1 1st Apr 2006 10:37 AM
C# P/Invoke to pass pointer-to-pointer-to-structure (**pPtr) to C =?Utf-8?B?YnJja2Nj?= Microsoft C# .NET 0 30th Nov 2004 11:29 PM
Re: Copying unmanaged memory pointer of structure to managed structure array Mattias Sjögren Microsoft VC .NET 0 28th Aug 2004 04:19 PM
Creating a table in Access based on structure of existing table Microsoft C# .NET 1 20th Dec 2003 04:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:22 AM.