|
Yeah, but that type of stuff IS really dangerous.
It works once you understood when to use it (at a InsertItem() with a LVITEM / TVITEM.pszText for example).
But IMHO it is nothing to tell beginners. Shhhh!
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
|
Hello I am looking for a source to get the common toolbar xp icons as described here[^]. I am really looking for the source files because I want to use them with alpha blending so I really need the transparency channel and it won't work if I just screencap and crop. I have been looking for them in systems DLL without luck.
Does anyone know?
Regards,
Nicolas
|
|
|
|
|
hey all,
i'm a beginner and have one problem.
I want to program a CListCtrl(report-view) object with the resource-editor within a non-modal dialog. Always when I declare a variable with the assistent for the object(CListCtrl variable), i get a DEBUG ASSERTION FAILED during carring out my application. Why?????
The same Project within a modal dialog works fine.
Can everybody help me???
thanks
Stefcos
|
|
|
|
|
What is the file and line # of the fired assertion?
|
|
|
|
|
Is there a easy way to acces desktop icons and move them around in x and y pos?
I think I saw a program that did that a while ago.
/Jarek
He believed the commercials that said drink beer, get laid
but at closin' time he was alone, he didn't get paid.
Last night his lover was a razorblade..
"Dan Reed song Mix it up"
What do you want to patch today?
|
|
|
|
|
How about getting a handle to the desktop window, and enumerating its child windows?
|
|
|
|
|
Okey sounds interessting but do you have some sample code or an example?
I never did it before!
/Jarek
He believed the commercials that said drink beer, get laid
but at closin' time he was alone, he didn't get paid.
Last night his lover was a razorblade..
"Dan Reed song Mix it up"
What do you want to patch today?
|
|
|
|
|
Something like:
HWND hDesktop = GetDesktopWindow();
EnumChildWindows(hDesktop, EnumProc, 0);
BOOL CALLBACK EnumProc( HWND hWnd, LPARAM lParam )
{
return TRUE; // to continue enumeration
}
I've not ever needed to do something like this before, but I suspect it will return more windows than just the icons. Top-level applications probably have the desktop as their parent window, too.
|
|
|
|
|
Thank you David!
I tryed that to and its just like you said it return manny windows, to manny.
But the search goes on I found a VB program that doing this and I am on my way to disassamble the code!
I think I have something to learn here It started as an effort to make a funny program but now its a chalange!
/Jarek
He believed the commercials that said drink beer, get laid
but at closin' time he was alone, he didn't get paid.
Last night his lover was a razorblade..
"Dan Reed song Mix it up"
What do you want to patch today?
|
|
|
|
|
Try this:
LPMALLOC pMalloc;
LPSHELLFOLDER pDesktopFolder = NULL;
HRESULT hResult;
LPITEMIDLIST pidlItems = NULL;
LPENUMIDLIST ppenum = NULL;
ULONG celtFetched;
SHFILEINFO fi = {0};
hResult = SHGetMalloc(&pMalloc);
if (NOERROR == hResult)
{
hResult = SHGetDesktopFolder(&pDesktopFolder);
if (NOERROR == hResult)
{
hResult = pDesktopFolder->EnumObjects(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &ppenum);
if (NOERROR == hResult)
{
while (hResult = ppenum->Next(1, &pidlItems, &celtFetched) == S_OK && (celtFetched) == 1)
{
SHGetFileInfo((const char *) pidlItems, 0, &fi, sizeof(fi), SHGFI_PIDL | SHGFI_ICON | SHGFI_DISPLAYNAME);
TRACE2("Icon handle for ]%s[ = %#x\n", fi.szDisplayName, fi.hIcon);
pMalloc->Free(pidlItems);
}
ppenum->Release();
}
pDesktopFolder->Release();
}
}
|
|
|
|
|
Thank you David!
It works I can get the Desktopicons
I saw similar code in Q&A on MSDN Thank you again your code was better.
/Jarek
He believed the commercials that said drink beer, get laid
but at closin' time he was alone, he didn't get paid.
Last night his lover was a razorblade..
"Dan Reed song Mix it up"
What do you want to patch today?
|
|
|
|
|
I've been reading some messages and articles, but I haven't found any example of using a DLL to store classes and then use them linking it dynamically in an exe.
At present, I'm using Delay Load to create instances of my classes, but I don't want to use .lib and .h files.
Is it possible to do that?
Thanks in advance.
|
|
|
|
|
|
Cedric,
I think you might be overshooting the target here. COM is one thing, but you might also simply export a C++ coded class with the __declspec(dllexport) statement in MSDEV, and import it with __declspec(dllimport). Of course that technique requires C++ to be used on both sides (unlike COM).
Bernd
|
|
|
|
|
Yep, that's rigtht, but in this case, you'll have to include the .h and the .cpp files from all your classes in the project then!
If you use a 'kindof' COM model, you'll just have to include the .h file from the interface (just virtual functions), and then use a global function from the dll that returns a pointer to the base class that is in fact 'a pointer to a specific child class'. So, in that way, you don't have to include .h and .cpp files from all your derived classes. The client program doesn't even know the existence of the derived classes: he just call virtual functions from the base class that are redirected to functions from the derived class.
Or, I perhaps misunderstood the question ?
|
|
|
|
|
You didn't misunderstand the question, but the DLL export statement...
You have to include header files in both sides (there is no type library query or so), but the code stays on the server side (DLL). Just look at the whole thing as if it were a good old function library, only with dynamic linking, classes, C++, and so forth.
This is not a "kindof COM", this is a C++ class library. Plain, simple, and useful.
Bernd
|
|
|
|
|
But I think, that exporting anything C++ means that the another compiler might not be able to import it (due to different non-standard name mangling) and you must use the same compiler then. But I can be wrong.
|
|
|
|
|
Agreed. Exporting a class from a DLL does not allow for multi-language use, or multi-compiler use.
I agree COM is the more powerful tool in places, but it also is an overkill in many others.
Bernd
|
|
|
|
|
Thanks for all the answers, but I'm not looking for a COM interface. Instead of that, I'd like to use plain DLL's, but as I've just read, I'd have to include .cpp files on both sides and that's what I don't want to do.
All I want is to give a DLL without giving even the header files. I don't want any .h or .lib.
Hope I've explained better this time.
Thanks in advance!!
__________________________
Fernando de Francisco Cano
__________________________
|
|
|
|
|
Fernando,
if you want to ship a library, then you must allow clients to connect to that library. One technique is to use static linkage. To do that, you will ship a .lib file and a header file. Another technique is dynamic linkage, for which you will ship a .DLL and a header file. Finally, you could ship COM controls, which come in the physical form of .DLL or .OCX files. You don't need to include header files because COM provides query mechanisms, but essentially in any case you cannot just ship something without letting your user's compiler know what it is.
You seek the impossible unless you don't wish your DLL to be of any use - in which case you could just ship a DLL without a header file
Bernd
|
|
|
|
|
... oh, and in order to get this clarified: you do not ship source code (except header files), unless you wish to. None of the three techniques I listed requires distribution of .cpp files, no whatsoever.
B.
|
|
|
|
|
First of all, thanks a lot for your soon answer .
I have to ship .DLL + .h file if I want to use Dynamic linking (as you wrote earlier) but... am I able to use classes from this .DLL? I mean without using COM.
Another question: Must I ship the whole .h file? I mean, do I have to ship private, protected and public zones? I'd like to hide private data at least.
Thanks in advance.
__________________________
Fernando de Francisco Cano
__________________________
|
|
|
|
|
I used extended style LVS_EX_HEADERDRAGDROP.
So, I can drag-drop a header.
How to get notification of drag-drop of headers in CListCtrl
whenever it was changed?
Thanks.
|
|
|
|
|
Derive a class from CListCtrl and handle the notifications in the derived class.
|
|
|
|