473,326 Members | 2,104 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,326 software developers and data experts.

Experts please: defining DllMain in static library

Hi,

Is it possible to define DllMain in a static library for use in dlls? The
reason is that I am defining a platform abstraction for being loaded as a
shared library and I figured the simplest way is to implement DllMain in a
static library, which then calls mydllmain.

I define this library (call it platform.lib) which has DllMain implemented
with what should be unresolved references to mydllmain. I then link it into a
bunch of dll's. Unfortunately, this doesn't work as the linker doesn't
include platform.lib's version of DllMain.

I have explored all the linker flags, but I am lost on this one. I have also
added DllMan to the EXPORTS section of the .def file in the hope that may
force the linker to look in my static library for the symbol.

Can someone please help? I don't see any clean way to do this without
passing around some object filenames (which is why archive libraries were
invented!)

Thanks!
Mar 20 '07 #1
1 3157
"Sean Connery" wrote:
Hi,

Is it possible to define DllMain in a static library for use in dlls? The
reason is that I am defining a platform abstraction for being loaded as a
shared library and I figured the simplest way is to implement DllMain in a
static library, which then calls mydllmain.
Argh! /include:_DllMain@12
Mar 20 '07 #2

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

Similar topics

1
by: Matthew Hanna | last post by:
I am writing a short OpenGL application in Visual Basic. I need an extension that I can't get from the VB side. I create a dll named glFogCoordf_Vb.dll to do the work for me. The dll fails to...
22
by: ByteSize | last post by:
Dear All, Please, this is not meant to be offensive - but it is a challenge !!! I have posted on over a dozen so called 'vb.net' expert / blog sites - in the vain hope of finding a complete,...
4
by: Michael Roper | last post by:
In Jesse Liberty's "Programming in C#" he says that "...an assembly must have exactly one entry point: DLLMain, WinMain, or Main. DLLMain is the entry point for DLLs..." In the MSDN ".Net...
4
by: Madhu Gopinathan | last post by:
Hi All, I am faced with a horrible hang problem. I have a COM exe server that executes some tasks. The task execution manager is a thread that manages the pool of threads, which is 4 per processor....
7
by: Adam | last post by:
I have a managed cpp wrapper. Im using this in a native dll as a static variable. I need to free this library when the dll is done being used. The perfect place to do this is DllMain for...
3
by: Jozsef Bekes | last post by:
Hi All, is there a mechanism just like DllMain in VC6, a function that gets called whenever an assembly gets loaded? Thank you for all answers. Jozsi
2
by: Vincent Fatica | last post by:
I can get Explorer to load (via LoadLibrary()) my DLL using VirtualAlloc(), WriteProcessMemory(), and CreateRemoteThread() (a technique discussed here occasionally). But I'd really like to...
3
by: Abubakar | last post by:
Hi, I have a dll that gets called by an exe, I just placed a little code in its dlmain method and put a breakpoint on the code only to discover that its getting called nearly hundreds of times. I...
10
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, From MSDN, http://msdn2.microsoft.com/en-us/library/ms682583.aspx parameter fdwReason of DllMain has four values, DLL_PROCESS_ATTACH
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.