|
Hi
Can anybody help me in finding the contents of Clip board. Here I am able to find the text item of clip board , but if clip board contains file links, images then I have problem
Please guide me ( better if provide some code snippets)
Thanks
|
|
|
|
|
Have you looked into the clipboard API:
OpenClipboard()<br />
EnumClipboardFormats()<br />
GetClipboardData()
etc.
"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
|
|
|
|
|
|
|
how can i get the main windows of apps that has a button on the window's taskbar?
|
|
|
|
|
|
Did anyone use 3rd argument in random_shuffle.
As I start the project for the first time it always sort the array the same way, I wonder if 3rd argument will help
9ine
|
|
|
|
|
Yes it would allow you to provide your own randomising function possibly with something a little more random than the rand() function.
You say it always sorts the same way, did you forget to call srand() first? Faliure to do this would cause the same random numbers to be be produced. A common method is to call srand(time(NULL)) though it's been a while since I used it.
|
|
|
|
|
no I didnt call srand(time(0)) before random_shuffle().
I thought it was useful only before rand() function call?
Does random_shuffle() use rand() function for generation? And it does not call srand() initialization in it?
If somebody knows how to paste custom function into 3rd argument?
9ine
|
|
|
|
|
I'm guessing that it would use rand() given that it's already in the libraries and that your output is always the same. It wouldn't make sense if srand() was called on your behalf since you would never know what is being passed to it.
Did calling srand() work for you? you didn't say.
|
|
|
|
|
yes after calling srand() before random_shuffle() it randomize sequency differently with every run
9ine
|
|
|
|
|
hai iam beginnar in vc++ , I want to know the difference between Runtime and link time.
"the client code can load the DLL and link to the functions at run time (instead of at compile time and link time). 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."
Iam Quoating this from "Inside ATLCOM"
krishna
|
|
|
|
|
Krishnatv wrote: "the client code can load the DLL and link to the functions at run time...
This is also called explicit linking.
Krishnatv wrote: ...(instead of at compile time and link time).
This is also called implicit linking.
Both terms can be Googled for.
"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
|
|
|
|
|
basically :
- compile-time (or compilation) is when the compiler take each .cpp (or .c in C) files to create the relative .obj.
- link-time is when the linker links every object files of the compilation to generate the project output.
- run-time is when you execute the program...
|
|
|
|
|
Run time is the time at which you run the program and compile time is the time at which you comile the program (yes, really ).
So what does that mean ? It simply means that (in your case) the dll functions are loaded when you run your program. So during compilation and linking, these particular functions are not 'merged' with your program.
|
|
|
|
|
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
|
|
|
|