|
When I changed tab control properties from porperties dialog to multiline ,application crashes. Waht si different to init tab when this option is selected
my init code in oninitdialog is
HIMAGELIST hList = ImageList_Create(16,16, ILC_COLOR8 |ILC_MASK , 8, 1);
m_cImageList.Attach(hList);
CBitmap cBmp;
cBmp.LoadBitmap(IDB_BITMAP_LIST_SMALL);
m_cImageList.Add(&cBmp, RGB(255,0, 255));
cBmp.DeleteObject();
m_tab.SetImageList(&m_cImageList);
m_tab.InsertItem(0,"Tab 1",3);
m_tab.InsertItem(1,"Tab 2",2);
m_tab.InsertItem(2,"Tab 3",7);
m_tab.InsertItem(3,"Tab 4",0);
|
|
|
|
|
Hi,
I want to import a class from a dll dynamiclly by using LoadLibrary(DLLFile)
and not by using Project->Settings->Link....
Is it the same as loading regular function from a dll(By getting a pointer
to that function)?
for example,if in my dll the function looks like this:
in my dll.h file:
#define TCPDLL_API __declspec(dllexport)
#ifdef __cplusplus
extern "C" {
#endif
TCPDLL_API ERROR_CODES FLRInitializeConnections(IPStruct *Server,int num_of_radars);
#ifdef __cplusplus
}
#endif
and in my dll.cpp file:
TCPDLL_API ERROR_CODES FLRInitializeConnections(IPStruct *Server , int num_of_radars)
{
}
now,when i want to use the function :
in my app.h:
typedef ERROR_CODES (*FLRInitializeConnections_PROC )(IPStruct*,int);
HINSTANCE hLib;
FLRInitializeConnections_PROC FLRInitializeConnections;
and in my app.cpp:
hLib = LoadLibrary(DLL name);
FLRInitializeConnections = (FLRInitializeConnections_PROC)GetProcAddress(hLib,"FLRInitializeConnections");
Now i can call the function from the dll.
My question is - in order to use a class from a dll , what should i do?
Do i need to get a pointer to that class or can i load the dll and make instance of that class in the regular way?
With best regards,
Eli
|
|
|
|
|
|
|
hi
I am facing the problem while unregistering the dlls in specif path.
I am getting the string as:
"c:\Program Files\Demo\abc.dll" now i have tried using Ssystem() and shellExecute() but it doesnot work if the folder name is having space then it does not work otherwise it works fine.
Can someone help me..
cheers
|
|
|
|
|
You should load the dll using LoadLibrary and call the DllUnregisterServer function and then unload the dll.
« Superman »
|
|
|
|
|
IN Continuation With Mr Santosh!
you must call CoIntialize(NULL) before Calling DllUnregisterServer
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Alok,
Is that mandetory?
« Superman »
|
|
|
|
|
Santosh M. P. wrote:
Is that mandetory?
yes Santosh, if you see defination of any DllUnregisterServer
STDAPI DllUnregisterServer(void)
{
return _Module.UnregisterServer(TRUE);
}
here DLLUnregisterServer is Using Com Interfaces and to use com interface COM must be Intialised!
Hope, you got my Point!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ThatsAlok wrote:
yes Santosh, if you see defination of any DllUnregisterServer
CoIntialize() is used to Initializes the COM library. That is if you are using any com library functions you do this. But _Module is not created with CoCreateInstance() or something like that. So I don understand the need of CoInitialize() in this scenario.
suhredayan There is no spoon.
|
|
|
|
|
suhredayan® wrote:
That is if you are using any com library functions you do this. But _Module is not created with CoCreateInstance() or something like that
Hope So! Let's Try!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ThatsAlok wrote:
Hope So! Let's Try!
suhredayan There is no spoon.
|
|
|
|
|
I need source codes of video capture and video network transfers
Who can help me? thank you.........
|
|
|
|
|
|
hi
I have built the connection to the database and fetching the values first i hae to take in _variant_t and then convert in _bstr_t i have achieved that but myproblem is that:
I am using SQL 2000 and i have a field authString by default value is <null> when if i select that value which is null what should it return i am getting error .
I want to check if it is Null, If it is i will update that otherwise not .
what should i do.
jhon
|
|
|
|
|
Hi,
I need some advice/help in writing a program to parse XML file (using DOM) and returning element inside a particular tag. So if I select a tag identified by its tag value, it should give me the element inside that tag.
Appreciate all your help.
Thank you
Ray
|
|
|
|
|
|
|
Use Microsoft's javascript engine.
Don't try it, just do it!
|
|
|
|
|
Thanks for replying, but I didn't get any info about it, can you give me some introductory information regarding that. Thanks in advance.
http://www.priyank.in/
|
|
|
|
|
i have been Written a Hanoi's tower that base on GUI using VC++ development.
Now, the program has a few bugs, but i havn't know where that errors are. soon i will revise these errors, maybe the program is fun and u can take the Hanoi's tower to study recursived program with C or C++, For the moment, the source codes can't opening line but that will be quickly, [There ]is to download the program demostration.
Any proposes as follow comments.
|
|
|
|
|
Hi All,
I am facing problem of handle leak in my Application.
While using AfxBegin thread creating a worker thread in suspended mode and then resuming the thread using resumethread.
During above process 7 Handles are getting created but when I am exactly closing the thread using PostThreadMessage(WM_QUIT, NULL, NULL) only 5 handles are getting closed. Two handles are not being closed.
The details is like This:
m_pControlThread = AfxBeginThread (
ControlThreadLoop,
( LPVOID )this, THREAD_PRIORITY_NORMAL,
0, CREATE_SUSPENDED
);
m_pControlThread->ResumeThread();
from above 7 handles are getting opened.
In Destructor Closing like this:
if (m_pControlThread)
{
m_pControlThread->PostThreadMessage(WM_QUIT, NULL, NULL);
WaitForSingleObject( m_pControlThread->m_hThread,
_MESSAGE_TIMEOUT );
delete m_pControlThread;
}
Here only 5 Handles are getting closed...
Where remaining 2 handles are missing .... I am not getting any Idea..
Please suggest..
Thanks,
Jokhan
|
|
|
|
|
That could be normal behaviour. Windows likes to keep some handles around to be reused later. The way to check if this is the case is to run and stop your thread multiple times. If the total handle count does not keep climbing you are ok, if it does climb you have a problem.
ie: handle count is 0...7...2...7...2...7...2...7... etc OK
" " " 0...7...2...9...4...11...6...etc Error
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Hello Arends,
Thanks for your suggestion.
You are right but In my case the total ( after few iteration of start and stop) number of handles are increasing. And it is 2 handles per iteration.
And As I have written in posting: while quiting the thread only 5 handles are getting closed though each time 7 handles are getting opened.
Please suggest!!
Thanks,
Jokhan
|
|
|
|
|