Yes, I got exactly that same error message when I tried to "disable Visual Styles", to see if it would make a difference..
So it looks like I've got to take that "very long" road I mentioned..
Well, like I said, in the long term, that's probably a good thing (I'm trying to stay positive)..
So let me ask you: what size Icons are you passing in to the LoadIconMetric() function(s)?
I'm passing in 32x32 pixel Icons, and trusting that the LoadIconMetric() function will either squash it down to the appropriate size, or return an error code if it can't. However, I can no longer trust even the most obvious of assumptions any more, which is why I'm asking..
Also, I can't download your project because you have to be a member of whatever to do so.. But that doesn't matter much - I'm.. uh.. somewhat familiar with the code..
This is maddening - according to you, the code works fine - it just doesn't work for me.. 'cause I'm.. special.. or cursed.. or something..
Well, whatever. Ignore the previous paragraph. I guess I'll just have to keep slogging it out..
I don't think that a code couldn't work because someone is marked by the obscure forces.
First of all, it was was my wrong about the new operator because it seemed to me that you destroyed the buffer exiting the function.
Of course to use a static or dynamic allocation makes no difference, what really counts is that the memory stay there when shell functions are called.
The Shell_NotifyIcon, with a lot of bugs as usual for MS products, couldn't be not functional. There is a sea of 64 bits applications out there that works.
My personal idea is that the problem is not in your code for Shell_NotifyIcon, but somewhere else. Probably you would take a tighten look to the whole code and try debugging to see if the buffer is consistent each time you use the Shell_NotifyIcon function.
when i run above code i have got following error: EntryPointNotFoundException: Unable to find an entry point named 'hello' in DLL 'lib.dll' 1****<-Click 1 for image
I know about how to call function only(without using Class) of vc++ DLL from C# but i don't know how to call method of any class and how to code that in proper way in vc++.
I know somewhere is mistake in my above code, please experts guide me about my mistake because i tried all from my side.
If anyone has full example like above then suggest me.
1. If you want to call functions like that in a C++ DLL, you shouldn't put them inside classes.
2. There is an issue called C++ Name Mangling. This is where the linker exports the functions with additional characters that describe the function signature. To call the functions by their names directly, you must place the definitions inside an "extern C" declaration like so:
I use IAccessible and presently I can get text string from Internet Explorer. I put my code below. But how I can get one word from this text string directly under mouse pointer? Not whole string, ,only one word under mouse pointer?
Thanks in advance.
I'm beginner and I need a little help. I have to make RPN (postfix) calculator using stack which is implemented by singly linked list in C. Now I found that but in C++ and I'm having trouble translating it to C. Can you help me getting things to work? I have started from http://www.mediafire.com/view/q833x5sic8eq4sx/from_c__.txt and using a little code from http://www.mediafire.com/view/ewz9so6999ig5x0/using_c.txt I get to http://www.mediafire.com/view/qesca0cg0vzjzac/to_this_in_c.txt code and it debugs but when I enter anything in console it crashes and gives me some assembly code I'm using VS C++ 2010. Please help me to fix this, I can't find what's wrong.
You already posted this request in the quick answers thread.
As already told you, you don't have post links, but code (just for your knowledge the links are not even working).
Just a small direction: compile your code with debug info, open a debug session and localize where your code fails. Restrict the place, extract a small snippet showing the problem and post only that small piece if you want any help.
Back when I was in school, we made our own RPN calculator from scratch (after spending weeks discussing data structures and algorithms on the chalkboard), not converting it from one language to another. As a result, I understand how they work.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
This is a looooonnnnggg conversation. If you're just starting out, I'd look at what other widget libraries have done. You'll probably also find that a lot of widget libraries have grown into full out frameworks.
Here are a few to look at:
WTL literature/examples are scattered here and there, and there is very minimal
support to it
Documentation, or lack thereof, would be a deal breaker for me, I vote for MFC as there are TONS of examples and lots of documentation. I can't remember the last time I really cared about the size of an executable.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
One of the strongest arguments in support for using WTL over MFC was the fact that executable of WTL will be around 4x smaller in size than statically linked MFC Application.
Now, given the fact that we are living in 2015 now, does it really matter? If your program is 8MB or 2MB?
Well, when it comes to MFC, you should probably be dynamically linking to system installed dll's anyways. In that case, the size of the libraries doesn't really matter since you'd be sharing the system MFC libraries (instead of bloating the application).
I am developing an application to copy USB memory sticks. As part of this app, I want to be able to eject the memory sticks when copying is complete. (I DO wonder whether this is necessary as I do a file flush before closing the file) I found a nice little utility (deveject) to implement this and am calling it using WinExec() - I do realise that this is very old and I should be moving on to CreateProcess(), but it has worked well for me in the past and I'm in a bit of a hurry !! Although WinExec() returns 33 (which indicates success), the drives are still accessable aftyerwards and so deveject presumably has not executed properly As a test for the command line used, I placed it in a batch file (deveject -EjectName:"USB Mass Storage Device") in the same directory as deveject.exe, and it executes perfectly, releasing all USB sticks. However, if I use WinExec() to call this batch file, then it doesn't work (but good return code from WinExec() )
So my question is - what am I doing wrong when using WinExec() ? Should I be doing something (permission-wise)to allow the WinExec command line to execute ? My code is as follows:-
const CString quote = "\""; // This is actually the character '"'
szCmdLine = "D:\\StickCopier\\deveject -EjectName:" + quote + "USB Mass Storage Device" + quote;
uiRC = WinExec(szCmdLine,SW_HIDE);
(The command line formed is exactly what I used in the batch file)
Would greatly appreciate any help on this daft (but perplexing) problem !!
Thanks for your reply ! I have tried your suggestion but this change produces the command line "D:\StickCopier\deveject -EjectName:""USB Mass Storage Device""" in the debugger (i.e. a PAIR of double quotes whereas single double quotes are needed for the argument to EjectName
Since my original posting, I have tried ShellExecute() and am getting a similar result - ShellExecute() succeeds (RC = 42, which is greater than 33), but the USB stick is still mounted.
New code is as follows:-
CString szFile = "D:\\StickCopier\\deveject.exe";
const CString quote = "\""; // This is actually the character '"'
CString szParameters = "-EjectName:" + quote + "USB Mass Storage Device" + quote;
CString szDirectory = "D:\\StickCopier\\";
hInstance = ShellExecute(NULL,"Open",szFile, szParameters, szDirectory,SW_HIDE); // returns 42 (> 33 so no error
I try to explain with an example: I create a CBitmap object used to put a bitmap on a custom button control.
Do I have to destroy the object when I exit from the program or the object is automatically destroied?
Last Visit: 22-Jul-19 1:47 Last Update: 22-Jul-19 1:47