|
MSFLXGRD.OCX
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Does someone know how to export/import classes in dll? I wonder if it is possible as in .NET
|
|
|
|
|
Yes it is possible with the use of Microsoft-specific storage-class specifiers __declspec(dllimport) and __declspec(dllexport) , much as it is done for regular functions.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Why is it so difficult to create a docking windows with a tree inside it! WHY WHY!?!?!?
BYE
|
|
|
|
|
Hi,
How do you play a sound at the beginning of an MFC program, without having any user interaction?
Like, how the ICQ program plays a sound at start up.
Thanks
|
|
|
|
|
Um.. ::PlaySound ? Check it out in the MSDN.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I have a control subclassed from CRichEditCtrl that has command handlers for the standard edit commands. This control is declared as a member of a class that is subclassed from CView. The problem is that when the control has the focus, it does not receive any commands.
What's the cleanest way to route commands to the controls on the CView?
It appears that CView doesn't route any commands to its children. I have overridden the CViews OnCmdMsg method and passed messages to the children by calling their OnCmdMsg methods, but this does not work perfectly. Mainly, I can't get the ON_COMMAND_UPDATE_UI stuff to work properly. Any help will be appreciated. Thanks.
|
|
|
|
|
I have a control which displays information in 3 different places on itself. When one piece of information changes, I have to repaint the whole control. Sometimes, only one piece of information changes many times very quickly, so I end up re-drawing the whole control for everytime. Is there a way to mark a region or part of a control that needs to be re-drawn, not the whole thing?
-Mark Lenz
|
|
|
|
|
- Call CWnd::InvalidateRect() and pass it the RECT of the area that needs to be redrawn.
- In your painting code, check the DC's invalid region (it's a CDC or API function, I can't remember the name ATM) and only repaint that region.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
i have a big problem linking a dll.
i thing the functions in the dll are old and are declarated with
__export, and can match this in my prototypes because
VC++ 6 doesn't know what __import is .
1. with lib i make from the dll lib file, which i build with
my project, still no errors
2. then in header files i try to write the prototypes
something like that
extern "C" MTELConnect(...);
the compiler says no, and i use the __declspec(dllimport) also.
it compiles successfully,
but when tries to link
i got the following mistake
error LNK2001: unresolved external symbol __imp__MTELConnect
somebody help me
|
|
|
|
|
Well you have quite a problem here...
If I'm not wrong, yo're trying to use an old 16-bit DLL with your 32-bit VC++ compiler. Unfortunately, this cannot be done directly. 16- and 32-bit are separate worlds inhabiting different memory spaces and they simply cannot be freely mixed.
I strongly suggest that you consider the possibility of getting the source code of that 16-bit DLL and try to recompile it with your 32-bit compiler (some modifications will surely be required). This is by far the easiest solution, if you can afford it. If for some reason this is not an option, keep reading.
To enable a 32-bit executable to call functions of a 16-bit DLL, you need an intermediate DLL that is able to speak both languages and make the translations necessary between them. This is what Microsoft call a thunk. They provide a thunk compiler and instructions on how to build 32-to-16, 16-to-32 and bidirectional thunks (on NT platforms, 32-to-16 is alas forbidden). A couple of URLs to start reading:I had to build one of these thunks in the past and it is no easy task, though not impossible either, and the docs are pretty explanatory. Good luck if you enter the thunk trail.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
ups, sorry i was confused
the truth is that the dll was compiled with the _export clause,
but know when i get much involved in the things i saw
that when i generate an import .lib file
with lib.exe /def:mydll.dll
and then when i dumpbin /exports mydll.lib
i get this
Dump of file mydll1.lib
File Type: LIBRARY
Summary
C3 .debug$S
14 .idata$2
14 .idata$3
4 .idata$4
4 .idata$5
C .idata$6
that means there is no exports there, and that i can't properly use
lib.exe (btw when i make the .lib file it gives me an warning
mydll1.dll : warning LNK4017: MZР statement not supported for the target platform; ignored
btw because i'was in a hurry i manage to run the library with LoadLibrary
and GetProcAddress, but i still want to manage the other way
best Stanislav
|
|
|
|
|
Try adding the function to the EXPORTS section of your def file. BTW the compiler should generate the .LIB for you.
|
|
|
|
|
I wrote successfully regular DLL by MFC AppWizard. "MyDLL.DLL"
My DLL import himself another DLL. "OuterDLL.DLL"
When MyDLL imports the OuterDLL statically (with the LIB file)it is all right.
But if it performed by Dynamic Linking (with LoadLibrary), When I try activate that MyDLL from client program (exe)I gets the following message error:
============================================================
The value of ESP was not properly saved across a function call .
This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
=============================================================
Is this say that it impossible use Dynamic linking in DLL ?
|
|
|
|
|
Is this say that it impossible use Dynamic linking in DLL ?
No, it is perfectly possible to have dynamic linking of functions defined inside a DLL. You just have to do as the warning suggests and fix the calling convention used by the function. To use the example of your previous post, instead of
DWORD Func1(DWORD,char*); write
DWORD WINAPI Func1(DWORD,char*); and now define SQRTPROC as
typedef DWORD WINAPI (SQRTPROC) (DWORD,char*); Hope this helps.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I tried it as following:
=============================================
HINSTANCE hInstance;
VERIFY (hInstance = ::LoadLibrary("c:\\windows\\system\\OuterDLL.dll"));
typedef DWORD WINAPI (SQRTPROC) (DWORD,char*); //Line 86
SQRTPROC* pFunc;
VERIFY (pFunc = (SQRTPROC*) ::GetProcAddress(hInstance, "MyFunc"));
==============================================
And I got in compilation the following errors :
MyDLL.cpp(86) : error C2059: syntax error : '('
(87) : error C2065: 'SQRTPROC' : undeclared identifier
(87) : error C2065: 'pFunc' : undeclared identifier
etc...
|
|
|
|
|
err... try this:
typedef DWORD (WINAPI * LPSQRTPROC) (DWORD,char*);
LPSQRTPROC pFunc;
VERIFY (pFunc = (LPSQRTPROC) ::GetProcAddress(hInstance, "MyFunc")); Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have a dialog that's undergone heavy modifications, and I'm left with a ton of extra IDC_ values for controls that no longer exist.
Is there any utility or way to have it remove the unused control values?
I've also been expericing "duplicate control IDs" when renaming some. The bugger is that there are no duplicates. There were, but those were renamed or deleted, but it thinks they are stil there.
Thanks in advance
|
|
|
|
|
Go to View->Resource symbols. The ones in use will have a check mark, so you can delete the ones w/o checks.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
You might want to try this handy addin by Andy Metcalfe:
http://www.codeproject.com/macro/resorg.asp
It may help to solve your resource id woes.
Cheers
|
|
|
|
|
Hi All,
I've got a big problem and could somebody kindly give me a hand?
The requirement is to use WebBrowser control and display content in Anti-alias font. Assume 'smooth edges of screen fonts' display property is not checked. (we can't assume it is checked) How I can make the content of WebBrowser control render in Anti-alias font?
I've got some ideas but most of them are proven to be not working. Now, I'm thinking of solutions like creating a 'HFont' with 'CreateFont' that takes a 'ANTIALIASED_QUALITY' 'fdwQuality' parameter. And put the HFont to system by 'AddFontMemResourceEx' function. And let the HTML to specify using the new font. Do you think this method can work? any other good suggestions?
Thx and regards,
mingfai
Reference:
AddFontMemResourceEx: adds the font resource from a memory image to the system.
http://msdn.microsoft.com/library/en-us/gdi/fontext_23zs.asp
|
|
|
|
|
I have 2 fils in a project :
1 Cpp file and the second C file .
a variable x is declared in the Cpp file and i need that
the C file will "know" that variable.
is there supose to be a problem?
when i tried this:
Cpp File C_File
int x; extern int x
i get an error : unresolved external
I will be very glad to get any help
|
|
|
|
|
Put this in your .h:
#ifdef __cplusplus
extern "C" {
#endif
extern int x;
#ifdef __cplusplus
}
#endif and this in your .cpp:
#include <···.h>
int x;
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
meirav wrote:
int x; extern int x
hmmmm...
dont put both in the same file.
file1.cpp -> declare it there :- int x;
file2.c -> extern "C" int x;
Try that.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
If I have 2 radio boxes and I want to make sure the user can check only one of them at a time (ie if the user checks one, the other gets automatically unchecked).....then how do I do this?
Thanks.
|
|
|
|