473,388 Members | 1,340 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,388 software developers and data experts.

VC8 GDI+ dll in VC6

Hi,

Can I write a VC8 dll which used GDI+ and then use this dll in VC6.
I will be using GDI+ to basically load a image in memory and annotate it
with some text and save the image.

Any pointers on how I can do this?

Thanks,
-Asfar
Mar 23 '06 #1
8 2285
Asfar wrote:
Hi,

Can I write a VC8 dll which used GDI+ and then use this dll in VC6.
I will be using GDI+ to basically load a image in memory and annotate
it with some text and save the image.

Any pointers on how I can do this?


You can, as long as you expose a pure C (or COM) interface to your VC8 DLL.
If you expose functions that have MFC, ATL or STL types in the interface,
you won't be able to call those functions from VC6. If you expose functions
that have GDI+ types in their interface, it _might_ work, depending on
whether VC6 and VC8 can both compile the exact same version of GDI+ and
whether you have all the options for the two compilers set in a compatible
way.

In your case, if all you want to do is load, annotate and save an image,
your exported function probably needs little more than a path, so it should
be doable.

-cd
Mar 23 '06 #2
> Can I write a VC8 dll which used GDI+ and then use this dll in VC6.
I will be using GDI+ to basically load a image in memory and annotate it
with some text and save the image.


The functionality itself should not be difficult to figure out.
www.codeproject.com has plenty of GDI+ articles and code samples.

build a class that does what you want to do. after that you can either build
a C style wrapper that exposes the desired functionality of that class, you
can build an activeX control that exports that functionality, or you can
build a managed class library and use it via COM interop.

Should you go for the C style wrapper dll, then you also have to be careful
to respect memory ownership. I.e. do not let the dll allocate memory that
will be deleted by your VC6 app, or vice versa.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"

Mar 23 '06 #3
> Can I write a VC8 dll which used GDI+ and then use this dll in VC6.

Why do you want to ? GDI+ is an unmanaged library that you could call much
more easily direct from VC6 unmanaged code.

Cheers
Doug Forster
Mar 23 '06 #4
"Doug Forster" <doug_ZAPTHIS_AT_ZAPTHIS_TONIQ_DOT_CO_DOT_NZ> wrote in
message news:uY**************@TK2MSFTNGP11.phx.gbl...
Can I write a VC8 dll which used GDI+ and then use this dll in VC6.


Why do you want to ? GDI+ is an unmanaged library that you could call much
more easily direct from VC6 unmanaged code.


What's that got to do with VC8, which is just as capable of generating
native code as VC6 was?

-cd
Mar 23 '06 #5
> What's that got to do with VC8, which is just as capable of generating
native code as VC6 was?


Nothing at all. I was presuming the OP had some undisclosed reason for
wanting to work within VC6.

Mar 24 '06 #6
Just to continue...

I also supposed the reason the OP wanted to use VC8 for the dll was because
he was under the common misapprehension that GDI+ was a managed library and
that he needed managed code to use it.
Mar 24 '06 #7
Thanks guys. I was of the opinion that GDI+ was managed code.

"Doug Forster" <doug_ZAPTHIS_AT_ZAPTHIS_TONIQ_DOT_CO_DOT_NZ> wrote in
message news:eS**************@TK2MSFTNGP11.phx.gbl...
Just to continue...

I also supposed the reason the OP wanted to use VC8 for the dll was
because he was under the common misapprehension that GDI+ was a managed
library and that he needed managed code to use it.

Mar 24 '06 #8
Doug Forster wrote:
Just to continue...

I also supposed the reason the OP wanted to use VC8 for the dll was
because he was under the common misapprehension that GDI+ was a
managed library and that he needed managed code to use it.


Good call :) I'd never heard the misperception that GDI+ was managed, but
apparently it is common!

-cd
Mar 24 '06 #9

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

Similar topics

10
by: **ham | last post by:
I know that's an old dirty issue; GDI+ almost -the slowest part of the framework - has bothered many developers using it in animations. Even in managed C++ the performance is awful. Now, any dude...
6
by: James dean | last post by:
I have heard that the video drivers in GDI+ are a big performance issue. But is this only an issue with something like Games Programming i think...is this wrong?. What about a drawing application...
1
by: James dean | last post by:
Could someone explain how this works. I think the graphics card is used to do blitting and drawing shapes like rectangles. How does it draw using the Graphics card on the PC and why is this feature...
6
by: James dean | last post by:
I want a good site that will show clearly how much more functionality GDI+ has. I cannot seem to find anything other than sites that list "some" of the new functionality that GDI+ offers. A...
7
by: | last post by:
We create VC++ programs that does some GDI drawing functionality. I discovered GDI+ and this seems to be a big step forward, and appears to be standard available in Windows XP and Windows Server...
0
by: Brian Keating | last post by:
hi there i've a test program that creates a treeview and destroys it over and over, i keep track of the gdi object count for the process and see if they are ok. However when i switch on...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
7
by: Marcin Rzeznicki | last post by:
Hello, Do you think it is legitimate practice to mix GDI+ and GDI calls (via Get/ReleaseHDC()) in paint event of a control? I've heard there is possibility of performance loss while "locking"...
5
by: Jonathan Boivin | last post by:
Hi, I've got some problems with loading bills using a bill usercontrol I built. If I load all current bills in my test environment (156) everything is fine once, but repeating the operation...
1
by: Chris Dunaway | last post by:
When working with GDI+, calling the CreateGraphics method to draw on a control has normally been frowned upon and it is always emphasized to dispose of pens and brushes and other GDI objects lest...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
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.