|
Hi
Use Win32 Dynamic-Link Library wizard with option "a dll that exports some symbols"
it makes some defines for you like these:
#ifdef MY_EXPORTS
#define MY_API __declspec(dllexport)
#else
#define MY_API __declspec(dllimport)
#endif
modify them a little:
#ifdef MY_EXPORTS
#define MY_API __declspec(dllexport)
#elif defined(_STATIC_MY_LIB_)
#define MY_API
#else
#define MY_API __declspec(dllimport)
#endif
and use MY_API before your classes:
class MY_API CMyTestClass {};
now your should define in dll-project (wizard made it for you) MY_EXPORTS
don't define any (MY_EXPORTS|_STATIC_MY_LIB_) in projects that use your dll
you can make lib-project using same source files just define _STATIC_MY_LIB_ in project settings.
ZMike.
|
|
|
|
|
Hi All,
I want to convert 16 grayscale BMP image to DOS 4-plane format image, in order to display
the BMP image on DOS screen.
Please give me some help. Thanks
|
|
|
|
|
In my work environment I deal with a lot of Access and therefore VB. But just creating standalone database interface applications, how much faster is VC++ accessing/querying a database as opposed to VB. What difference between DAO,ADO,ODBC,etc.
Cheers
Robbie G
|
|
|
|
|
VC++ won't be much faster accessing Access databases than VB. The database work is performed by Jet engine anyway. I believe that you could improve performance with large datasets by using OLEDB via ATL COnsumer Templates.
Keep in mind that OLEDB requires skilled C++ programmer. I wouldn't recommending this path if you just switched from VB to VC.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I need to be able to (de)compress any file that comes in to my program. I use C/C++/Win32API/MFC 4.2. I would like the highest compression rate possible. I don't care to use libraies other than the standard libraies to use C/C++/Win32API/MFC 4.2.
How do I enable (de)compression in my program?
Any sites?
|
|
|
|
|
Actually, C++ is largely a superset of C, so you don't need to specify C/C++ - unless you intend on using one of the exception pieces of C code that don't work in C++, you are using C++ and that is that. Almost every C program is valid C++.
There are a number of options that rapidly slam shut with this line:
>>I don't care to use libraies other than the standard libraies to use C/C++/Win32API/MFC 4.2.
As MFC/Win32 do not come with any compression schemes, you can either renege on your desire not to use a library, or write your own. If you choose the former - check out zLib. If the latter, let us know how it turns out.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
|
|
|
|
|
I'm reading a binary file and at one point there are a couple of bytes (in hex) that contain the number of files in the archive. I put this information into a char array and then print it out as hex. When I display this number using VC++ it is 6670 when it should be 3610. The difference is apprently between using big edian and little edian numbers. The 6670 is big edian. How do I convert?
modified 12-Jul-20 21:01pm.
|
|
|
|
|
The difference is the order in which the bytes are stored. Big endian is MSB (the "big end") first, and little endian is LSB (the "little end") first. So just use the C bitwise operators to reverse the bytes.
WORD w = 0x13A5;
WORD wReversed = ((w & 0xFF) << 8) | ((w & 0xFF00) >> 8);
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
When using Win32 function OpenPrinter. I has three parameters. I just wanted to get a printer handle. I tried to open local printer so first parameter and third was set to NULL. The second printer was the printer handle returned. But When I did so, the printer handle is NULL.
Can you tell me to how to get this handle and how to pass the parameter properly?
Thanks
|
|
|
|
|
OpenPrinter(strPrinter, &hPrinter, NULL);
Where strPrinter is the Printer name. This name is the same that you see in the Printer Folder.
In Windows NT/2000 you can set this variable to NULL, this indicates the local printer server.
hPrinter is the HANDLE that returns the function.....
Is Simple. If don't work the problem is with the name of the printer
Cheers!!!
Carlos Antollini.
|
|
|
|
|
You can also create a CPrinterDialog ( or whatever it is called ) and get the PrinterDC from it, if you just want the default printer.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
|
|
|
|
|
Hi there,
simple question:
my programm should perform a last action when windows (2k) is going to shut down.
right now my action is in OnDestroy() and works fine, if the programm closes, but not on shutdown ..
Can you help me ..
thx in advance
bye
murphman
|
|
|
|
|
Have a peek at WM_QUERYENDSESSION (?) message. I think you can perfrom your required actions here.
Chris
|
|
|
|
|
|
Does anyone know I can change the text-color of ONE item in a CListCtrl?
thanks
|
|
|
|
|
That's easy - just handle NM_CUSTOMDRAW notification. Look for "Custom draw (listview)" in your VC++ help index.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Thanks for the tip!
unfortunately I still don't know how to use it in my Dialog based MFC-App
The help did't take me any further.
I want to draw e.g. the first item in red color, the second in green etc..
|
|
|
|
|
Examples are on the CodeProject website - just go to the "List control" section.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
|
Hi,
I like to know how can I get the length(in pixels) between two points.
can i get the length in some other unit too???
Thanks
Ehsan
Ehsan Behboudi
|
|
|
|
|
It's basic trig. If you have a right angle triangle, (a*a) + (b*b) = c*c. C is the side you are dealing with, so if your line is from 0,100 to 100, 47, then a = 100 and b = 100-47, 53. So the square root of (100*100) + (53 * 53) is the length of your line.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
|
|
|
|
|
Hi,
I like to know how can I get the length between two points.
Thanks
Ehsan
Ehsan Behboudi
|
|
|
|
|
Ehsan - is this question related to Visual C++?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi!
How can I program a function that checks whether the file has been modified? (e.g. changed dialogs etc.)
I have heard something about a CRC-Checksum..how to do that?
thanks in advance
|
|
|
|
|
My code :
CPen penObject;
penObject.CreatePen(PS_SOLID, 4, RGB(255,0,0));
CDCPoint->SelectObject(&penObject);
CDCPoint->MoveTo(100,100);
CDCPoint->LineTo(100,200);
Why the line is in colour BLACK instead of RED??????
Also, when i put:
CDCPoint->MoveTo(100,100);
CDCPoint->LineTo(100,100);
It cannot print a dot. It prints nothing.....do you know why????
|
|
|
|