473,804 Members | 3,603 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interop Structure with array of Structures

I have an interop question:

I'm trying to get the ICONDIR Win32 struct which contains an array of
ICONDIRENTRY structures to marshall correctly. The problem is that the array
isn't a set amount and could be any number of ICONDIRENTY structures. The
good news is that the ICONDIR structure does include the number of entries
in the ICONDIRENTRY array. How do I properly marshal the structure so that I
can properly recieve all the structures in the array?
Thanks,
Jacob
Nov 16 '05 #1
2 3770
Hi Jacob!

"Jacob" schrieb
I have an interop question:

I'm trying to get the ICONDIR Win32 struct which contains an array of
ICONDIRENTRY structures to marshall correctly. The problem is that the
array isn't a set amount and could be any number of ICONDIRENTY
structures. The good news is that the ICONDIR structure does include the
number of entries in the ICONDIRENTRY array. How do I properly marshal the
structure so that I can properly recieve all the structures in the array?


Did you try the IconHelper-class from John Hornick [MS] ?
http://groups.google.de/groups?selm=...40cpmsftngxa10

Cheers

Arne Janning
Nov 16 '05 #2
Thanks for the tip. I ended up doing the same approach myself... reading the
icon data out bit-by-bit instead of trying to marshall the whole thing at
once.

Jacob
"Arne Janning" <sp************ *****@msn.com> wrote in message
news:u1******** ******@TK2MSFTN GP11.phx.gbl...
Hi Jacob!

"Jacob" schrieb
I have an interop question:

I'm trying to get the ICONDIR Win32 struct which contains an array of
ICONDIRENTRY structures to marshall correctly. The problem is that the
array isn't a set amount and could be any number of ICONDIRENTY
structures. The good news is that the ICONDIR structure does include the
number of entries in the ICONDIRENTRY array. How do I properly marshal
the structure so that I can properly recieve all the structures in the
array?


Did you try the IconHelper-class from John Hornick [MS] ?
http://groups.google.de/groups?selm=...40cpmsftngxa10

Cheers

Arne Janning

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
2419
by: Mannequin* | last post by:
Hi all, I'm working on a quick program to bring the Bible into memory from a text file. Anyway, I have three questions to ask. First, is my implementation of malloc () correct in the program to follow? Second, have I correctly passed the structure's pointer to the functions in this program?
15
2789
by: damian birchler | last post by:
Hi I'm wondering of what type a structure is. Of course, it is a _structure_, but an array isn't an _array_ either. So of what type is a structure? I'd say a pointer, am I right?
3
3200
by: Keith M | last post by:
Could some kind soul illustrate how I can call the EnumPrintProcessors Win32 API from c# code? BOOL EnumPrintProcessors( LPTSTR pName, // print server name LPTSTR pEnvironment, // environment name DWORD Level, // information level LPBYTE pPrintProcessorInfo, // processor data buffer DWORD cbBuf, // size of data buffer LPDWORD pcbNeeded, // bytes received or required
3
1765
by: Steve | last post by:
Hello, I created a public Structure in a Standard Module and also an array of Structures. Then I load data into the array of structures in a public sub that I call on the Form load event. Next I have a class, and I want to pass a structure member from my array of Structures to the class constructor. In the form I instantiate a class object. Module1
17
1859
by: Aaron | last post by:
I've got a doozie of a problem! I and others have been trying to figure this out for too long and I've come to the conclusion that I should probably look for some support.. Ok, I have a COM component written in C++ (I don't have the source just the binary) and am referencing it from VB. I would say about 99% of the functionality exposed by this COM component works fine from vb .net but I am having a problem calling a method which has a...
0
1642
by: Ivan | last post by:
Hi All, I have a problem with marshaling complex structures (containing numbers, strings, arrays of another structures) to native C function in dll. I have already posted same question to .compactframework thread, but nobody helped. main problem is that I have tried all the workarounds I have found in the Inet but nothing worked... I tried passing IntPtr, Byte Arrays, Serialisation, even used OpenNETCF, but
8
2474
by: ulyses | last post by:
I'm trying to put pointer to flexible array of structures in other structure. I want to have pointer to array of pixels in screen structure. Here is mine code, but I think it isn't quite all right: struct pixel { int x; int y; int color; };
6
2413
by: Nataraj1978 | last post by:
I have a requirement to use a dll written in Visual C++ 6.0 in my C# application. In order to establish the link between my application and the dll, I have written a ATL COM Component in Visual C++.NET . This COM component is referenced in my C# application. The COM component statically links with the 6.0 dll. I am facing problems in passing data from C# to the dll through the COM component. Description: 1. The dll exposes a function...
5
3802
by: =?Utf-8?B?QXlrdXQgRXJnaW4=?= | last post by:
Hi Willy, Thank you very much for your work. C++ code doesnot make any serialization. So at runtime C# code gives an serialization error at "msg_file_s sa = (msg_file_s) bf.Deserialize(ms);" I thought that it is very hard to memory map structure array. I need both read and write memory mapped file at both side of C# and C++.
0
9710
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9589
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10329
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9163
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3830
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.