|
I am trying to implement Ole drag and drop,
and the register() with OLE dll is returning 0.
where could i have been wrong?
Thanks
|
|
|
|
|
You need to use OleInitialize on the thread that is calling the register function rather than CoInitialize. OLE must be initalized in order for you to use Drag and Drop.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
how to integrate the windows file manager in a visual c++ application ? i want the user to be able to navigate through the directories, select files, copy files (ctrl+c), paste files (ctrl+v), cut files (ctrl+x), rename files (F2), drag and drop (to copy/move/make shortcut, etc.), refresh automatically if the directory content is changed, explorer context menu on right mouse button, etc. (all the windows explorer functions)
...but i don't want to code anything myself. i only want to use a component, a library or something like that.
|
|
|
|
|
Just host a instance if IE and set the initial path that you want teh user to start at like C:\. You can even set it to "My Computer".
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
|
Theres an article in ShellProgamming called SeaShell, which has some classes. There not exactly perfect and i went through it for about a month before i gave up but then again I needed a lot of functionality which it didn't have.
Using IE is simple but causes problems when you double click on a folder, it opens it up in another window instead of the same.
In the end for me i'm using a commercial activeX control called the 'Shell Active X Control Pack' Its pretty good you can get it from http://plasmatech.com.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
indeed, seashell isn't perfect yet. how to host an instance of IE in my application ? maybe there's a way to prevent it from opening another window...
|
|
|
|
|
I am in the process of writing a library which will allow users to make any MFC doc/view app have a plug in architecture. It will be published as an article here if I can get it to work. The problem I have at the moment is that I need to copy the standard MFC MESSAGE_MAP architecture. Now assuming I have got a pointer to a MESSAGE_MAP object, I need to dispatch with a call to
_AfxDispatchCmdMsg
The problem I have is that when I link my example project and library, I get a unresolved external symbol "int __stdcall _AfxDispatchCmdMsg(blah blah blah) error.
Now this function should be part of the standard MFC architecture, and thus part of my project, because when I comment out the call to it, you can step into this function by going throught the MFC layers until you get to CWnd::OnCmdMsg() where it is called from in the MFC library!
So, how can I link to this function? What library/dll/include etc would I need to use?
Cheers!
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Do a search in /mfc with keyword : "AfxDispatchCmdMsg".
With VS7, I get nafxcw.lib (nafxcwd.lib in debug)
Add a reference to this library.
You may also just as well take the code from this function, which is in /mfc/cmdtarg.cpp, and put it in your own code (especially in the case you intend to replace MFC).
And I swallow a small raisin.
|
|
|
|
|
Yeah, that's pretty much what I did looking for it, but my find in files search found the nafxcw.dll, but not the library file.
Anyway, thanks for the effort. I will give it a go.
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Theres a program that I have (i didn't make it) and there is a 'refresh' button. When you click the button the rogram rewrites a file, then displays the info from that file. What I want to do is wait until that file is opened and edited, then add some stuff of my own to it before it's closed by the program. Can that be done?
There's always one more bug.
|
|
|
|
|
I want to make a 100% OOP app and if that's gonna be true the entry point (main or WinMain) must belong to a class. But how!? I know it's possible but can't find out how!!!
Help me please!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
It's called Java.
Jeremy Falcon
Imputek
<nobr>"C# is the answer to a question nobody asked." - Chris Losinger
|
|
|
|
|
no, i don't think that's possible with C/C++, though maybe it is with .Net.
-c
Argue for your limitations, and sure enough, they're yours.
|
|
|
|
|
You can do that, but you will have to create a static member function for your class. Then set the entry point to your app to be that static member function.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I tried making main() static like:
public:
static int main()
{
return 0;
}
...
but it said an error that I can't remember!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
You do realize that not every function should belong to a class? main is a good example of that
Todd Smith
|
|
|
|
|
Yes, but I have seen a messgage here on CP loooong long time ago and someone answered it and said it was possible!
.....
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
What is the series of Win32 API calls to determine how much memory a process is holding on to? For example, this set of API calls should give a bigger number each time I call malloc(), etc.
Thanks for your help
|
|
|
|
|
2GB per process. (4GB addressable, 2GB for kernel, 2GB for user).
Add /3GB in boot.ini to get 3GB for user, 1GB for kernel.
And I swallow a small raisin.
|
|
|
|
|
GetProcessHeaps + HeapWalk can be of use, but maybe a simple GetProcessWorkingSetSize wold do in this case.
|
|
|
|
|
No, it doesn't work, at least according to the way I've tried to use it. The following code always returns the same values (workingset size never changes):
#include <windows.h>
void main()
{
long minn, maxx;
long nbytes=1;
while (1) {
GetProcessWorkingSetSize(GetCurrentProcess(), &minn, &maxx);
printf("%ld %ld\n", minn, maxx);
malloc(nbytes);
nbytes *= 2;
Sleep(1000);
}
}
#include <windows.h>
C:\temp>workingset
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
204800 1413120
|
|
|
|
|
I was hoping someone could help me with a little problem I am having. I am new to COM and after a lot of research and helpful articles, I was finally able to write my first COM dll. One of the most suggested articles is the one about creating an outlook dll for office 2000. So I structed my dll around this. I used the #import for the type libs and was actually able to create my own button. I am not doing this for outlook but instead of word and excel. What I was wondering is if there is a way to know, programatically, what version of office the machine has? The #import statements are located in the stdafx.h. But is there a way to check if Office XP, then use the #import statements for Office XP and if not, use the ones for Office 2000 libs? I have looked through a lot of code and I found a complete of alot ideas but with the way the dll is put together, since I am not using the msword.h and such, they don't work for me. Can anyone give me any suggestions!!!!!!
|
|
|
|
|
You can import both of the interfaces into your DLL and then select which one to use at run-time.
Todd Smith
|
|
|
|
|
How would I do that? Since I would have to put all the #import statements in stdafx.h, it wouldn't compile unless I had both installed on my machine. It would look for MSO9.dll and MSO.dll. I am a little lost on how to do this!
|
|
|
|