473,785 Members | 2,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Upgrade problem - help required

Hi,

I am upgrading a VB6 project that used a stdPicture and passed it's handle
property to a DirectX 7 API function.

VB .net doesn't support the stdPicture and advises using
system.drawing. image as an alternative, but the .net image control doesn't
have a handle property.

I have worked out how to add a stdPicture object to my .net project by
adding a reference to stdOLE, but now I can't work out how to load a picture
into it. In VB6 I used the LoadPicture() function, but this isn't available
in .net.

Can someone either suggest a way to obtain the handle for the .net image or
advise how to load a picture into a stdPicture object.

Thanks,

Martin Horn.
Nov 21 '05 #1
4 1302
I haven't tried this myself, but the PictureBox .NET control has a handle
property that you might be able to pass to the DirectX 7 API.

You can load an image into the picturebox with:

PictureBox1.Ima ge = System.Drawing. Image.FromFile( fileName)

HTH,
Scott Swigart
www.swigartconsulting.com
blog.swigartcon sulting.com

"Martin Horn" wrote:
Hi,

I am upgrading a VB6 project that used a stdPicture and passed it's handle
property to a DirectX 7 API function.

VB .net doesn't support the stdPicture and advises using
system.drawing. image as an alternative, but the .net image control doesn't
have a handle property.

I have worked out how to add a stdPicture object to my .net project by
adding a reference to stdOLE, but now I can't work out how to load a picture
into it. In VB6 I used the LoadPicture() function, but this isn't available
in .net.

Can someone either suggest a way to obtain the handle for the .net image or
advise how to load a picture into a stdPicture object.

Thanks,

Martin Horn.

Nov 21 '05 #2


"Martin Horn" wrote:
Hi,

I am upgrading a VB6 project that used a stdPicture and passed it's handle
property to a DirectX 7 API function.

VB .net doesn't support the stdPicture and advises using
system.drawing. image as an alternative, but the .net image control doesn't
have a handle property.

I have worked out how to add a stdPicture object to my .net project by
adding a reference to stdOLE, but now I can't work out how to load a picture
into it. In VB6 I used the LoadPicture() function, but this isn't available
in .net.

Can someone either suggest a way to obtain the handle for the .net image or
advise how to load a picture into a stdPicture object.

Thanks,

Martin Horn.

Nov 21 '05 #3
Hi Scott,

thanks for the reply, but I have already tried using a picturebox and
passing the handle property without any success.

Regards,

Martin.

"Scott Swigart" <sc***@swigartc onsulting.com> wrote in message
news:E9******** *************** ***********@mic rosoft.com...
I haven't tried this myself, but the PictureBox .NET control has a handle
property that you might be able to pass to the DirectX 7 API.

You can load an image into the picturebox with:

PictureBox1.Ima ge = System.Drawing. Image.FromFile( fileName)

HTH,
Scott Swigart
www.swigartconsulting.com
blog.swigartcon sulting.com

"Martin Horn" wrote:
Hi,

I am upgrading a VB6 project that used a stdPicture and passed it's
handle
property to a DirectX 7 API function.

VB .net doesn't support the stdPicture and advises using
system.drawing. image as an alternative, but the .net image control
doesn't
have a handle property.

I have worked out how to add a stdPicture object to my .net project by
adding a reference to stdOLE, but now I can't work out how to load a
picture
into it. In VB6 I used the LoadPicture() function, but this isn't
available
in .net.

Can someone either suggest a way to obtain the handle for the .net image
or
advise how to load a picture into a stdPicture object.

Thanks,

Martin Horn.

Nov 21 '05 #4
In case anyone else has the same problem, here is a solution that worked for
me.

Dim fs As New System.IO.FileS tream(Applicati on.StartupPath &
"\Invader1_1.bm p", System.IO.FileM ode.Open)
Dim b As New Bitmap(Applicat ion.StartupPath & "\Invader1_1.bm p")
Dim handle As IntPtr
handle = b.GetHbitmap()

handle can now be passed to the DirectX API function and everything works as
expected.
Nov 21 '05 #5

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

Similar topics

1
2993
by: cpchan | last post by:
According the documentation from Metalink, the following files are required for the Oracle Upgrade from 8.1.6 to 8.1.7 : u0801060.sql c0801060.sql a0801060.sql i0801060.sql utlip.sql However, after install 8.1.7, I could only find 4 of them, but no
16
2238
by: Braxton Beyer | last post by:
I have just added a message to my website, wellheard.com, notifying WinIE users that their browsers will not render the site correctly as the site uses PNGs with alpha transparency. I then give them a link explaining why they should not use IE and the benefits of upgrading to another browser. My question is has anyone ever done this and what was their experience. I would like feedback and comments. Why isn't their a browser switch...
2
304
by: Danny | last post by:
What is required before you have the MS Access upgrade, or the Office pro upgrade? Thanks
1
1494
by: SKG | last post by:
Hi all We currently use a split A2k database system with about 10,000 clients / 45,000 orders / 90,000 order entries etc with about 17 users (only 8 users do editing) We currently upload data to a internet search engine via a 4d database by means of exporting text files from access into 4D and then uploading to the web, however the web site search engine needs a major overhaul as it currently sees data in a flat file format only which...
6
3672
by: Terry Bell | last post by:
We've had a very large A97 app running fine for the last seven years. I've just converted to SQL Server backend, which is being tested, but meanwhile the JET based version, running under terminal server, has suddenly started running very slowly. The network engineer has thrown up his hands and said "It's Access 97". I've checked out lots of things including the Oplocks setting and other stuff from this NG, and I think I've done everything...
1
1616
by: noone | last post by:
I upgraded VS 2003 and asked my ISP (MaximumASP) to upgrade the server to net 1.1. That was two weeks ago and I am having a problem that will not go away. When publishing the site from VS I get an error that 1.1 cannot be found. Tech takes a few days to figure it out and consult with MS before the come to the conclusion that a file called get_aspx_ver.aspx is missing or needed, since the file could not be found the get_aspx_ver.aspx ...
4
5672
by: john | last post by:
I'm having some Interop problems. I really need someone's help on this, i'm running out of ideas. I have upgraded my Data access controls to the latest ver. Now then i have a form with these ref's: Interop.DAO,System,System.Data,System.Drawing,System.windo ws.forms,System.XML. all that's on this form is a button and when the button is clicked it opens up a fox pro database and gets the needed info/close. Now this works just fine on my
4
1108
by: Goofy | last post by:
I bought VS2003 in 2003 of course :) Now I want to upgrade but I was wondering when you install an upgrade if it A.) Requires that VS2003 be already installed B.) Overwrites it or allows side by side operation. Cheers
2
8471
by: KR | last post by:
Hi, We are running a test upgrade form sql 2000 standard edition to sql 2005 developer edition. Followed through all the steps and specified the account(SA priveleges and currently used by the 2000 version) and is the local admin on the box for the services and the setup seemed to move fine, except for when it got to the point of installing database services - This is the error message that I got: MSSQLServer could not be started. ...
1
892
by: Paul Cheetham | last post by:
Hi, I have had an old VS6 MFC application dumped on me and I am attempting to upgrade it to VS2005. I have a problem in that the filebuf::open command now only takes 2 parameters instead of 3. The fianle parameter (the protection parameter) is no longer required. That's fine, and I can find that information in a number of places, but what I don't seem to be able to find is what I should do...
0
9645
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
9480
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
10327
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
9950
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...
1
7499
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
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
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...
1
4053
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
3
2879
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.