473,386 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

OleCreatePictureIndirect() WinAPI call problem

I got problems with the WinAPI call OleCreatePictureIndirect() in C#.

Has anybody ever used this function call in C#?

Thanks,

Minfu
Nov 17 '05 #1
6 4688
Minfu,

What kind of problems are you having?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Minfu Lu" <Mi*****@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
I got problems with the WinAPI call OleCreatePictureIndirect() in C#.

Has anybody ever used this function call in C#?

Thanks,

Minfu

Nov 17 '05 #2
The purpose of using this function is to copy the image of a form to the
system clipboard.

Nov 17 '05 #3
Yes, but you say you are having problems. What are the problems you are
having?

Also, have you checked http://www.pinvoke.net for the definition of the
function in .NET?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Minfu Lu" <Mi*****@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
The purpose of using this function is to copy the image of a form to the
system clipboard.

Nov 17 '05 #4
This problem is the fouth Out paramter IPicture. I defined a
System.Drawing.Iamge variable and passed it as Out. An unhandled exception
occurs every time when I call this function. I searched
http://www.pinvoke.net, but there is NO any info for this API.

Nov 17 '05 #5
Minfu,

Just curious, why do you want to call this API? You can take the handle
of an Icon, or bitmap, and pass it to the static FromHbitmap method on the
Image class, or to the static FromHandle method on the Icon class.

Or is there another reason you want to use this API?

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Minfu Lu" <Mi*****@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
This problem is the fouth Out paramter IPicture. I defined a
System.Drawing.Iamge variable and passed it as Out. An unhandled exception
occurs every time when I call this function. I searched
http://www.pinvoke.net, but there is NO any info for this API.

Nov 17 '05 #6

"Minfu Lu" <Mi*****@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
This problem is the fouth Out paramter IPicture. I defined a
System.Drawing.Iamge variable and passed it as Out. An unhandled exception
occurs every time when I call this function. I searched
http://www.pinvoke.net, but there is NO any info for this API.

"Out" means that the callee returns a value, you should not pass anything
but an IntPtr, the received value is an Interface pointer for the COM
Interface requested (in second arg.), this interface can be used to access
the COM IPicture object that corresponds to the bitmap passed as first
argument.
But, I have to ask why you need to call this function, you are trying to
mix System.Drawing.Image (GDI+ ) with COM based (OLE) GDI access, this is
something you try to avoid by all means.

Willy.
Nov 17 '05 #7

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

Similar topics

1
by: Qindong Zhang | last post by:
I have a API function which declared in VC++ like this: DLLimport BOOL WINAPI bl_HERA16_SetPlayBuffer(int iChannel,BYTE **bpBuffer); How could I declare and call this function in C#. I have...
1
by: MuZZy | last post by:
HI, I would really appreciate some hwlp with this: Here is the WinAPI struct used in call to winapi function wavInGetDevCaps: typedef struct { WORD wMid; WORD wPid; MMVERSION...
0
by: Shao | last post by:
I am using VS.Net 2003 and I need to create a IPictureDisp pointer that points to a picture object. IPictureDisp *pd; PICTDESC pdesc; memset(&pdesc,0,sizeof(pdesc)); pdesc.cbSizeofstruct =...
1
by: Norman Chong | last post by:
Hi group, I want to get some information about the Windows version and ServicePack. I used the WinAPI but got the following problem: When I try to pass my OSVERSIONINFOEX structure ByRef to the...
3
by: Sin Jeong-hun | last post by:
Often, I need to call Windows APIs in C#. Signatures and macro constants can be easily found at MSDN but the constants values are not shown. I have to search the .h file for those constants values....
0
by: sslaughter | last post by:
Hello everybody! i've got new problem (which , as i suppose , shouldn;t be a problem for you) Here is the code: protected void notify_click(Object sender, System.EventArgs e) {
3
by: =?Utf-8?B?dGhlamFja29mYWxs?= | last post by:
I have a few global variables and a function that gets called multiple times to complete a single transaction and uses the variables. The function gets different notifications. When the function...
6
by: سعرَ | last post by:
Hi all! I have a Dll like this: #include <windows.h> #include <stdio.h> #include <stdlib.h> __declspec (dllexport) int Add (int n) { int x;
5
by: yoavrofe | last post by:
Hello all, I'm trying to run a small program on both PPC and CE devices. I am calling SHGetAutoRunPath only when running on a PPC platform. However, since this function depends on aygshell.dl,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.