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

DLL Entry Point

I have a small project that works fine as an EXE. Now I want to make
it into a DLL. I've created a DllMain routine and set it as the entry
point (code below). Then from DllMain I try to initialize my main
routine called ThreadProc. I've tryed this several different ways and
can't get it to work. It compiles fine but when I go rundll32
mydll.dll nothing happenes (works in exe form.)

BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call,
LPVOID lpReserved)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
HANDLE hThread = CreateThread(NULL,0,&ThreadProc,NULL,0,NULL);
CloseHandle(hThread);
}

return TRUE;
}

Any assistance would be greatly appreciated.

Sep 5 '07 #1
3 4069
FFrozTT wrote:
I have a small project that works fine as an EXE. Now I want to make
it into a DLL. I've created a DllMain routine and set it as the entry
point (code below). Then from DllMain I try to initialize my main
routine called ThreadProc. I've tryed this several different ways and
can't get it to work. It compiles fine but when I go rundll32
mydll.dll nothing happenes (works in exe form.)

BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call,
LPVOID lpReserved)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
HANDLE hThread = CreateThread(NULL,0,&ThreadProc,NULL,0,NULL);
CloseHandle(hThread);
}

return TRUE;
}

Any assistance would be greatly appreciated.
Wrong group. Try a group with "windows" or "microsoft" in its name.

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
Sep 5 '07 #2
FFrozTT wrote:
I have a small project that works fine as an EXE. Now I want to make
it into a DLL. I've created a DllMain routine and set it as the entry
point (code below). Then from DllMain I try to initialize my main
routine called ThreadProc. I've tryed this several different ways and
can't get it to work. It compiles fine but when I go rundll32
mydll.dll nothing happenes (works in exe form.)

BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call,
LPVOID lpReserved)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
HANDLE hThread = CreateThread(NULL,0,&ThreadProc,NULL,0,NULL);
CloseHandle(hThread);
}

return TRUE;
}

Any assistance would be greatly appreciated.
You will get an answer in microsoft.public.vc.language.
Sep 5 '07 #3
On Sep 5, 10:45 am, FFrozTT <t...@millennium.ab.cawrote:
I have a small project that works fine as an EXE. Now I want to make
it into a DLL. I've created a DllMain routine and set it as the entry
point (code below). Then from DllMain I try to initialize my main
routine called ThreadProc. I've tryed this several different ways and
can't get it to work. It compiles fine but when I go rundll32
mydll.dll nothing happenes (works in exe form.)

BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call,
LPVOID lpReserved)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
HANDLE hThread = CreateThread(NULL,0,&ThreadProc,NULL,0,NULL);
CloseHandle(hThread);
}

return TRUE;

}

Any assistance would be greatly appreciated.
This is a Windows question, not a C++ question, unless
I'm missing something. Try posting this on a Windows
programming group like those in
comp.os.ms-windows.programmer.*.

Sep 5 '07 #4

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

Similar topics

0
by: Sam Fields | last post by:
I have found very little regarding the error "Unable to find an entry point named EnumerateSecurityPackagesW in DLL security.dll. ". I have an ASP.NET Web Service being accessed via SSL. I found...
1
by: I am Sam | last post by:
Hi Everyone, I am new to Server control development and I am wondering how do I define the entry point for a server control? In a regular page you define Page_Load as an entry point and in a...
1
by: TRI_CODER | last post by:
I am trying to solve the following exception. The exception occurs when my ASP.NET code behind code attemtps to access a remore site using SSL. Please note that all certificates are valid and the...
5
by: Mike in Santa Rosa | last post by:
I'm trying to get a simple c# app built that can launch/manipulate an excel workbook, sheet. I've chased down several examples and can't any of them to work. So I must be doing somethnig obviouslt...
2
by: bboule | last post by:
Hi I have developped a dll that I want to use in another program ! here is my code : using System; using System.Collections.Generic; using System.Text; namespace NameSpace
10
by: Lung.S.wu | last post by:
Hi all, It is a history question. Recently, I read the book "C A reference manual, third edition". In this book, it list all C language keyword, and one is "entry". I know it is omitted from...
3
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, I am a developer from C++ COM to C# COM. I feel confused about the entry point function for a C# COM object. In C++, we always initialize object through GetClassObject or...
2
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, I am implementing a simple C# OLE DB Provider (C# COM Server). For C# (managed code), I am wondering what is the entry point (which coclass and which method), client will...
0
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, I have built MSDN OLE DB Sample Provider and successfully built/debug it using Microsoft Excel as client. I have found that in DllGetClassObject (classfac.cpp), the class...
5
by: Premkumar | last post by:
a.cpp ---------------------------------- #include <iostream> using namespace std; void mymain() { cout<<"my-main"<<endl; } ----------------------------------
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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,...

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.