473,472 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ATL project with Win32 DLL exported functions

Is it possible to have an ATL project that also contains win32 exported
classes and functions?.

I have a project (module) that needs to export/expose a few ATL objects,
however, other modules depend on the existing exported C++ classes. I
have been adviced that to export the ATL COM object, I should do the ff:

1). Create an ATL project
2). Move the existing code to it

I would like to know if the new project can still export its
classes/functions, so that other dependent code can continue to work?
Oct 29 '07 #1
4 2010
>Is it possible to have an ATL project that also contains win32 exported
>classes and functions?.
If you're asking: can an ATL DLL expose exported functions as well as
its normal COM object(s), the answer is yes.

Dave
Oct 29 '07 #2

"Anonymous" <no******@here.comwrote in message
news:DP*********************@bt.com...
Is it possible to have an ATL project that also contains win32 exported
classes and functions?.

I have a project (module) that needs to export/expose a few ATL objects,
however, other modules depend on the existing exported C++ classes. I have
been adviced that to export the ATL COM object, I should do the ff:

1). Create an ATL project
2). Move the existing code to it

I would like to know if the new project can still export its
classes/functions, so that other dependent code can continue to work?
You can't export C++ classes (This isn't a restriction of ATL, but a general
issue that Windows has no universal ABI for C++ classes), but if you have
exported functions you can still do so.
Oct 29 '07 #3
"Ben Voigt [C++ MVP]" <rb*@nospam.nospamwrote in message
news:O9**************@TK2MSFTNGP02.phx.gbl...
>
"Anonymous" <no******@here.comwrote in message
news:DP*********************@bt.com...
>Is it possible to have an ATL project that also contains win32 exported
classes and functions?.

I have a project (module) that needs to export/expose a few ATL objects,
however, other modules depend on the existing exported C++ classes. I
have been adviced that to export the ATL COM object, I should do the ff:

1). Create an ATL project
2). Move the existing code to it

I would like to know if the new project can still export its
classes/functions, so that other dependent code can continue to work?

You can't export C++ classes (This isn't a restriction of ATL, but a
general issue that Windows has no universal ABI for C++ classes), but if
you have exported functions you can still do so.
Yes C++ classes can be exported. Albeit not in the since that all
functionality is exposed but it is possible.

--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.
Oct 29 '07 #4

"Frank Hickman" <fhickman3_NOSP@M_noblesoft.netwrote in message
news:Oc*************@TK2MSFTNGP05.phx.gbl...
"Ben Voigt [C++ MVP]" <rb*@nospam.nospamwrote in message
news:O9**************@TK2MSFTNGP02.phx.gbl...
>>
"Anonymous" <no******@here.comwrote in message
news:DP*********************@bt.com...
>>Is it possible to have an ATL project that also contains win32 exported
classes and functions?.

I have a project (module) that needs to export/expose a few ATL objects,
however, other modules depend on the existing exported C++ classes. I
have been adviced that to export the ATL COM object, I should do the ff:

1). Create an ATL project
2). Move the existing code to it

I would like to know if the new project can still export its
classes/functions, so that other dependent code can continue to work?

You can't export C++ classes (This isn't a restriction of ATL, but a
general issue that Windows has no universal ABI for C++ classes), but if
you have exported functions you can still do so.

Yes C++ classes can be exported. Albeit not in the since that all
functionality is exposed but it is possible.
These things are safe for sharing C++ code:

Source code.
C-compatible exported functions, with a header with appropriate
declarations, and POD structs.
object v-tables, with either a header with pure interface declarations, IDL,
or a COM type library.

For the latter two you must respect memory ownership and always deallocate
in the same module which performed the allocation.

Anything else is highly compiler-specific, non-portable, and almost certain
to cause trouble with a compiler upgrade.
>
--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.


Oct 29 '07 #5

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

Similar topics

3
by: Ian | last post by:
Peace, language lawyers! I'm developing a (static) library for a "memory-challenged" platform (ie, mobile). I want to (force the compiler to) inline some functions -- that are not meant to be...
5
by: Howard Kaikow | last post by:
I have files to build a C project, including the makefile, what's the easiest way to import the project into C and C# in VS .NET Professional? I have both VS .NET 2002 and 2003. I have nothing...
2
by: Bret Pehrson | last post by:
I just need to confirm now (after I've spent several days chasing mystery metadata warnings/errors) that this is *NOT* possible: Link a managed C++ static library into a (managed) C# application....
0
by: Richard | last post by:
In VB.NET, I am successfully calling C++ functions and subroutines that were exported from a DLL. Is it also possible in VB.NET to directly access a variable that was exported? Specifically, the...
2
by: Victor | last post by:
Hi everybody ! I would like to consult a guru for the obstacle I cannot tackle alone. My environment is Visual Studio 2005 under Windows XP. I have two projects : (A) A DLL - HerHair.dll...
2
by: Amit | last post by:
how can i call one project function in other project within a single solution. plz tell me the solution
4
by: Bmack500 | last post by:
Okay, this is a pretty basic question. I've created a static library using c++. Now, I've started a vb.net project. How do I reference the functions in the static library? I'm using Visual Studio...
3
by: brett.mack | last post by:
Okay, this is a pretty basic question. I've created a static library using c++. Now, I've started a vb.net project. How do I reference the functions in the static library? I'm using Visual Studio...
3
by: capamaru | last post by:
hi there is there a way to get the hole win32 api to xml-rpc method? i know some functions from win32 api is not possible to be exported because they return objects but at least they will...
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
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
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...
1
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...
0
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,...
1
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...
0
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...
0
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 ...

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.