|
Krishnatv quoted: That way, only one copy of a given library resides on a disk at any particular time. All the clients of the DLL simply share that one copy of the library, freeing up disk space and memory resources for other things.
That assertion is not completely correct - some applications routinely place "private copies" of DLLs in their own runtime/installation directories. You may have heard the term "DLL Hell" in the past few years...
How DLL's are searched for (search order) can also screw around with applications if you are not careful or have odd things in your PATH.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
when your program is to be eceuted first it is compiled, then it is linked. in the linking process all the necessary header files and libraries and attached to your object file(i.e. the file got after compiling). this is called link time. after linking u get .exe of your source code.
now when this file is run for final output, it is called runtime.
i hope u r clear by now.
best of luck
RabiaAslam
|
|
|
|
|
Thank u for ur great help.
RabiaAslam
|
|
|
|
|
I have used CHelperLAyout Class to solve my positioning and resizing problem but I have a new problem that is: the ComboBox controls don't change their size . What to do
I lern my self
|
|
|
|
|
height of ComboBox is fixed for same fonts.
when u change height of combo-box, the height includes dropdown part.
in most cases, u should use a large number for its height, i.e. 200.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
I increase the height, some thing don't change.
How can I do so to have the same height for all control on my formview using this class CLayoutHelp.
|
|
|
|
|
I only get a 8.3 format filename through following code, and I want to get a long filename, how?
HINSTANCE hInst = AfxGetInstanceHandle();
if(FAILED(!hInst)) return E_FAIL;
CString strDllFileName;
DWORD Status = GetModuleFileName (hInst, (LPTSTR)(LPCTSTR)strDllFileName, MAX_PATH);
TRACE(strDllFileName);
by debugging, I find that the value of strDllFileName is F:\hu\DD\DETAIL~1\Debug\DETAIL~1.DLL , and the corresponding longname is F:\hu\DD\DetailDesign\Debug\DetailDesign.dll
Note:
I am programming in VC++ 6.0 , my Operating System is Windows XP , the Disk F: ,where the .dll file is located, is NTFS format.
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
ewighell wrote: ...I want to get a long filename, how?
Have you considered GetLongPathName() ?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hello
you can try this function which transform the path you get from GetModuleFileName...
<br />
typedef DWORD (__stdcall *GETLONGPATHNAME)(LPCTSTR, LPTSTR, DWORD);<br />
<br />
DWORD MyGetLongPathNameEx (CString& sPath)<br />
{<br />
DWORD dwRet = 0;<br />
<br />
HINSTANCE hdl = ::LoadLibrary ("KERNEL32.DLL");<br />
if (hdl == NULL)<br />
return dwRet;<br />
<br />
GETLONGPATHNAME pfnGetLongPathName = (GETLONGPATHNAME) GetProcAddress (hdl, "GetLongPathNameA");<br />
if (pfnGetLongPathName == NULL) {<br />
::FreeLibrary (hdl);<br />
return dwRet;<br />
}<br />
<br />
dwRet = (pfnGetLongPathName) (sPath, sPath.GetBuffer (_MAX_PATH), _MAX_PATH);<br />
sPath.ReleaseBuffer ();<br />
<br />
::FreeLibrary (hdl);<br />
return dwRet;<br />
}<br />
<br />
<br />
CString strDllFileName;<br />
DWORD Status = ::GetModuleFileName (hInst, (LPTSTR)(LPCTSTR)strDllFileName.GetBuffer (_MAX_PATH), _MAX_PATH);<br />
strDllFileName.ReleaseBuffer ();<br />
DWORD dwRet = ::MyGetLongPathNameEx (strDllFileName);<br />
TRACE(strDllFileName);<br />
|
|
|
|
|
use GetLongPathName after u have got the short file name.
I would like to comment that the statement
DWORD Status = GetModuleFileName (hInst, (LPTSTR)(LPCTSTR)strDllFileName, MAX_PATH); is wrong.
u should never cast CString like (LPTSTR)(LPCTSTR)strDllFileName. U may have unexpected results because of this. Use as follows
DWORD Status = GetModuleFileName (hInst, strDllFileName.GetBuffer( MAX_PATH ), MAX_PATH);
strDllFileName.ReleaseBuffer( -1 );
nave
|
|
|
|
|
Let me try to actually answer the subject of ou post...
That function dates back to 16-bit Windows, and my guess is that since only FAT-style 8.3 filenames were supported, Win32 inherited that behavior.
Also, note that the GetModuleFileName(...) function is one of the few that is capable of returning filepaths longer than MAX_PATH , so do not assume that MAX_PATH is always going to be long enough...
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hi!
Does somebody know, what I have to do, when there is a .rtf-File which should be converted to a WinHelp-File? I don't have a .cnt but a .hpj-File.
Thanks a lot, Hanno
|
|
|
|
|
You can open the Help Workshop tool provided with VS 6.0
In the help of Help workshop you can get the step by step procedure for developing the winhelp file.
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
As it happens, the plans for my next project is to create a HTMLhelp helper which would be able to do just this. As an alternative for now, you could open the file with MS word and save it as a HTML file, then compile it with the HTMLhelp utility. The problem with this is the HTML files are very bloated, so you might want to edit out all the nonsense with a text editor.
-- modified at 8:11 Monday 10th April, 2006
Sorry, I misread the title of your post as HELP-File whereas HTMLhelp actualy creates .chm files.
|
|
|
|
|
Hi,
can anyone plz tell me what may be the error ???
private:
CCreateDlg m_dCreateDlg; // error
CStatusDlg m_dStatusDlg;
Compiling...
UpdateDlg.cpp
d:\parichay\desktopsearch\desktopsearch\updatedlg.h(54) : error C2146: syntax error : missing ';' before identifier 'm_dCreateDlg'
d:\parichay\desktopsearch\desktopsearch\updatedlg.h(54) : error C2501: 'CCreateDlg' : missing storage-class or type specifiers
d:\parichay\desktopsearch\desktopsearch\updatedlg.h(54) : error C2501: 'm_dCreateDlg' : missing storage-class or type specifiers
Error executing cl.exe.
DesktopSearch.exe - 3 error(s), 0 warning(s)
|
|
|
|
|
you forgot to #include the header which contains the definition of the CCreateDlg ...
|
|
|
|
|
// UpdateDlg.cpp : implementation file
//
#include "StatusDlg.h"
#include "stdafx.h"
#include "DesktopSearch.h"
#include "CreateDlg.h"
#include "UpdateDlg.h"
#include "FoldersDialog.h"
I have added CreateDlg.h but still i am getting the same error
|
|
|
|
|
read my other answer...
you included the headers in the wrong file
|
|
|
|
|
Have you included the CreateDlg.h in you UpdateDlg.cpp file..??
if not then include it and try to bulid the application
CreateDlg.h file having the class definition of CCreateDlg class
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
// UpdateDlg.cpp : implementation file
//
#include "StatusDlg.h"
#include "stdafx.h"
#include "DesktopSearch.h"
#include "CreateDlg.h"
#include "UpdateDlg.h"
#include "FoldersDialog.h"
I have added CreateDlg.h but still i am getting the same error
|
|
|
|
|
you didn't read the errors properly :
d:\parichay\desktopsearch\desktopsearch\updatedlg.h(54)
you have to #include "CreateDlg.h" in the UpdateDlg.h !
one last thing :
move the "stdafx.h" include at the top of all other includes to avoid compilation problems due to the use of precompiled header.
-- modified at 8:12 Monday 10th April, 2006
|
|
|
|
|
UpdateDlg.h
#include "StatusDlg.h" // Added by ClassView
#include "CreateDlg.h" // Added by ClassView
#include CreateDlg.h is add in UpdateDlg.h also but still i am getting error
-------------------Configuration: DesktopSearch - Win32 Debug--------------------
Compiling...
UpdateDlg.cpp
d:\parichay\desktopsearch\desktopsearch\updatedlg.h(54) : error C2146: syntax error : missing ';' before identifier 'm_dCreateDlg'
d:\parichay\desktopsearch\desktopsearch\updatedlg.h(54) : error C2501: 'CCreateDlg' : missing storage-class or type specifiers
d:\parichay\desktopsearch\desktopsearch\updatedlg.h(54) : error C2501: 'm_dCreateDlg' : missing storage-class or type specifiers
Error executing cl.exe.
DesktopSearch.exe - 3 error(s), 0 warning(s)
|
|
|
|
|
Hi ,
just wondering :
Are you sure that your class's name is CCreateDlg and not CreateDlg(when creating a class with 'C' as a first letter - the class wizard , from some reason does not add the prefix 'C' to the claas name... ).
Regards,
Eli
|
|
|
|
|
you're wrong eli.
the class wizard removes the leading C to the file names containing the definition and the implementation of the class beeing created, not directly on the class name.
moreover, look at the errors returned by the compiler :
d:\parichay\desktopsearch\desktopsearch\updatedlg.h(54) : error C2501: 'CCreateDlg' : missing storage-class or type specifiers
yes, the class is effectively CCreateDlg
|
|
|
|
|
Hi v2.0.
You are right
I didn't see that he included the CCreateDlg header file in the Updatedlg implementation file and NOT in the UpdateDlg header file.
About the class wizard - for some reason , in my projects , the class wizard removes the leading C from the class name as well.
With best regards,
Eli
|
|
|
|