473,769 Members | 7,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling API with OLE_ HANDLE parameter

I have a file with binary data and a dll where I have to pass a
OLE_HANDLE which points to the data in the file.

How do I read the data (i presume as binaryreader) and then pass the
OLE_HANDLE to the function?

Thomas
Nov 20 '05 #1
2 3053
Can you be more specific about which API you are calling? It may be that
just loading the bytes from a FileStream will not work if the service you
are calling expects a handle of some sort.

In searching MSDN, I only find refernces to OLE_HANDLE where it refers to a
GDI handle, like an Icon or a Bitmap from COM-interop interraces such as
IPicture. (Usually, such such handles are passed between COM and .Net as
type System.IntPtr.)

John Rivard, Visual Basic Team
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: Thomas Schoch <to**********@s wissonline.ch>
| Subject: Calling API with OLE_ HANDLE parameter
| Date: Mon, 15 Sep 2003 10:01:58 +0200
| Message-ID: <q8************ *************** *****@4ax.com>
| X-Newsreader: Forte Agent 1.9/32.560
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.publi c.dotnet.langua ges.vb
| NNTP-Posting-Host: 217.11.39.245
| Lines: 1
| Path:
cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8
.phx.gbl!TK2MSF TNGP11.phx.gbl
| Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:136897
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb
|
| I have a file with binary data and a dll where I have to pass a
| OLE_HANDLE which points to the data in the file.
|
| How do I read the data (i presume as binaryreader) and then pass the
| OLE_HANDLE to the function?
|
| Thomas
|

Nov 20 '05 #2
John
It's a method of an ActiveX control that we are using. It reads it's
own data from the blob which has to be passed in a OLE_HANDLE.

Thomas

On Mon, 15 Sep 2003 19:45:49 GMT, jo****@microsot .com (John Rivard
[MSFT]) wrote:
Can you be more specific about which API you are calling? It may be that
just loading the bytes from a FileStream will not work if the service you
are calling expects a handle of some sort.

In searching MSDN, I only find refernces to OLE_HANDLE where it refers to a
GDI handle, like an Icon or a Bitmap from COM-interop interraces such as
IPicture. (Usually, such such handles are passed between COM and .Net as
type System.IntPtr.)

John Rivard, Visual Basic Team
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: Thomas Schoch <to**********@s wissonline.ch>
| Subject: Calling API with OLE_ HANDLE parameter
| Date: Mon, 15 Sep 2003 10:01:58 +0200
| Message-ID: <q8************ *************** *****@4ax.com>
| X-Newsreader: Forte Agent 1.9/32.560
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.publi c.dotnet.langua ges.vb
| NNTP-Posting-Host: 217.11.39.245
| Lines: 1
| Path:
cpmsftngxa07.p hx.gbl!cpmsftng xa10.phx.gbl!TK 2MSFTNGXA05.phx .gbl!TK2MSFTNGP 08
phx.gbl!TK2MSF TNGP11.phx.gbl
| Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:136897
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb
|
| I have a file with binary data and a dll where I have to pass a
| OLE_HANDLE which points to the data in the file.
|
| How do I read the data (i presume as binaryreader) and then pass the
| OLE_HANDLE to the function?
|
| Thomas
|


Nov 20 '05 #3

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

Similar topics

8
2963
by: Muthu | last post by:
I've read calling conventions to be the order(reverse or forward) in which the parameters are being read & understood by compilers. For ex. the following function. int Add(int p1, int p2, int p3); The parameters here can be read either in the forward order from p1 till p3 or reverse order from p3 till p1. Can anyone explain what is the advantage/disadvantage of either of
5
3034
by: Francesco Bochicchio | last post by:
Hi all, anybody knows if there is a (standard, portable) way to dinamically build a list of parameters to call a C function? Something like va_start & co, but to be used on the calling side? In other words, suppose that I have a generic pointer : void * f_ptr; I know that this pointer points to a fuction. I also know the function
3
4738
by: Webdiyer | last post by:
I want to integrate SecurID two-factor authentication system of the RSASecurity.inc into our asp.net application,but I get into trouble when trying to call the API functions of the ACE Agent,I got an error message saying "Cannot marshal parameter #2: Invalid managed/unmanaged type combination (this value type must be paired with Struct)" when calling "AceGetPinParams(iHandle,ref sd_pin)" function,here's my test code: private static...
7
4987
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type Parameter. I can call the first Method without Problems, the Parameter can be deserialized by the WebService. But if I want to call the second Method and give it an Array of Parameters, then the following exception is thrown by the WebService:...
0
1961
by: Przemys³aw Bana¶ | last post by:
Hello! Can anyone help me with calling Novell function from dll? I think my main problem is in translating C variable types to C# types. Here is the code: using System; using System.Collections.Generic; using System.ComponentModel;
2
2817
by: Daniel Lidström | last post by:
I'm using a library called fyba. This library reads and writes files in a format called sosi. fyba uses the following code to determine if the calling process has own methods to handle errors, messages, etc: // If this parameter is NULL, // GetModuleHandle returns a handle of the file used // to create the calling process. hInstExe = GetModuleHandle( NULL ); if( hInstExe!=NULL )
10
7000
by: SQACPP | last post by:
Hi, I try to figure out how to use Callback procedure in a C++ form project The following code *work* perfectly on a console project #include "Windows.h" BOOL CALLBACK MyEnumWindowsProc(HWND hwnd, LPARAM lparam) {
1
11321
by: obiwanjacobi | last post by:
Hi there, This is probably a really dump question but I'm stuck and need a leg- up with this. I'm writing a C++ interop layer that couples a managed plugin to an unmanaged host (specifically its a managed implementation for a Virtual Studio Technology -VST- plugin). So I'm writing a thin C++ layer that does little more than marshal calls to the managed layer. In this scenario I need to call a managed method with an out parameter
6
11581
by: Ole Nielsby | last post by:
VC has a __cdecl specifier which allows functions and methods to be called with varying parameter count. (I understand this is the default for functions in general but in VC, instances use another convention unless they have an ellipsis argument.) I can force GCC and other compilers to use such a convention by declaring all methods with an ellipsis, but I'd rather not clutter my method definitions with these.
0
9589
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
9423
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,...
0
10214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10048
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
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
8872
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...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5304
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...
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.