For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
IMO, changing the behaviour of a common control (such as CFileDialog) is a bad idea. Your users have grown to expect that common controls behave in a certain way, and changing that only makes your program less intuitive.
Perhaps you should think upon why you want to change this behaviour.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
The problem is maintaining consistency, I'm using an IFileDialog to open files on some computers, it all works as expected in win10, but on others win7 ultimate, the Open button has an arrow with a dropdown menu that adds a second option, "show previous versions".
i have a mfc application project in Visual studio 2010. it is a GUI infact.
i want to get communication with a mini circuit signal generator device. the device has a dll file named "mcl_gen64.dll
i want to use functions of that dll in my code but i dont have any idea how to do this
any idea please?
"ConnectByAddress" is a function in .dll file
when i run the code although the dll file is being loaded but i get this error:
Unhandled exception at 0x770115ee in fdll.exe: 0xC0000005: Access violation.
I have no idea why the error occurred, beyond saying that is is caused by a bad address reference somewhere. And the only way to find out where it occurred is by using the debugger. Are you certain that the parameter 0x01 that you send to the ConnectByAddress function is valid? Check the documentation to see what that function is supposed to do, and what it is supposed to return.
To use functions from a DLL you have two choices: Early and late binding.
Link your application with the DLL by using the #import directive in one file (usually a source file using functions from the DLL) specifying the file name (usually without extension or with .lib), or add the .lib file to your project settings (Linker - Input).
Include the header file and call the functions defined in that file.
This is only necessary if the DLL might not be present when your application is executed or you do not have a .lib file. Then use LoadLibrary and GetProcAddress like in your above example. But check both return values to be not NULL. Have a look at the header file (if present), to know how to define the function prototypes. Example:
typedefint (__stdcall *ConnectByAddressfuncPtr)(short Addr);
ConnectByAddressfuncPtr LibMainConnectByAddress = NULL;
HMODULE hLib = LoadLibrary(_T("mcl_gen.dll"));
LibMainConnectByAddress = (ConnectByAddressfuncPtr)GetProcAddress(hLib,"ConnectByAddress");
Note that I have initialised the function pointer with NULL and checked it before calling the function. Note also the __stdcall in the prototype declaration. It defines the calling convention used by the DLL. You have to check which is used (by inspecting the header file or asking the provider). __stdcall is common but it might be also __cdecl.
All I can suggest is to check if the DLL exports the function "ConnectByAddress" (e.g. using the Dependency Walker (depends.exe) Home Page[^] or executing dumpbin /exports path_to_dll on the command line; dumpbin is in the VC/bin folder) and trying it with different calling conventions like __cdecl.
I would use the Dependency Walker because it shows also the calling convention for the exported functions.
You omitted to mention that in your reply to me. If that function pointer is null then it will cause the error you have seen. You need to check the function name that you are trying to get the address for, does it actually exist in the dll?