|
There's one here AFAIK. I just #import and use it directly myself.
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
|
|
|
|
|
There might be a lot of wrapper classes for ADO's raw interfaces.
but it's so easy to use ado with three or more interfaces - _RecordsetPtr, _ConnectionPtr, _CommandPtr. Just make a SQL query string And open recordset , that's all.
|
|
|
|
|
I am programatically changing the font smoothing type in WindowsXP. In WindowsXP there are there settings: no font smoothing, standard font smoothing, and ClearType font smoothing. After diggin into MSDN I found that font smoothing can be set by calling
SystemParametersInfo(SPI_SETFONTSMOOTHING, TRUE, 0, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
I can enable font smoothing, disable font smoothing, and set font smoothing to ClearType.
I can not change the font smoothing mode to standard or change the smoothing contrast. I followed exactly as MSDN instructs but they fail. The MSDN article can be found here.
[edit]
Using GetLastError() it gives the error "The parameter is incorrect."
I am using
SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 1600, 0, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
copied staight from the MSDN article and I'm using the latest PlaformSDK.
[/edit]
And thanks goes out to Nish for steering me in the right direction. The SPIF_SENDCHANGE parameter actually tells it to send a WM_SETTINGCHANGE message.
Joshua
|
|
|
|
|
I am writing a program that was working fine until I added one more variable. Instead of 2 char* I now have three. Each char* is allocated using the new operator and a size of 524,920. Everything works fine until I put in that third variable. Now I get a dynamic memory overrun error, even when I don't touch the data.
Any Ideas?
Thanks in advance,
Clint
|
|
|
|
|
I've read there is a 64k dynamic allocation limit on arrays.
----
Xian
|
|
|
|
|
I'm not sure if this coincide with what you need...
I needed a buffer for file manipulation. The "new" seemed to be limited to 64k of memory. A work around this uses structures. Declare a structure with elements (in my case, BYTE) as array of size 0xff (65,535). If you need more than 64k of memory, declare more array of BYTE's. In order to use it, declare a variable of the structure and a pointer to BYTE. Then point the pointer to the first element of the structure, and voila!, you have a buffer array of more than 64k! Just use the pointer to access the buffer. (elements declared in a structure are allocated continously).
Note: if elements are of size 0xff each, I noticed that one can not have more than 16 elements. Ofcourse, I might be wrong.
typedef struct BUFFER {
BYTE Buffer0 [0xff];
BYTE Buffer1 [0xff];
...
BYTE BufferN [0xff];
} BUFFER;
void Some_Function ()
{
BUFFER Buffer;
BYTE *pBuffer;
pBuffer = Buffer.Buffer0;
memset (pBuffer, 0, <size_of_the total="" array="" of="" buffer="">);
...
}
|
|
|
|
|
Just vondering why you don't use malloc() instead.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Well from the CRT source code it looks like malloc was using from the dynamic heap. I looked into the heap size and it can't be bigger than about 500k. I ended up just saving that precious heap and used GlobalAlloc instead.
|
|
|
|
|
It uses memory from the global heap. It's no problem to alloc 50MB with malloc()
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Yo.
How can I paint on a CDialog wnd a *.gif picture, without using CHtmlView.
I want *.gif cause' I can use pics with transparent bkgrnd.
(I know howTo with *.bmp, that's not the case)
10x in advance,
\/*** Bar-Cochva ***\/
|
|
|
|
|
You'll need GDI+ or a third party library to use gif, and if you do, beware the evil Unisys license. Otherwise, the MSDN explains how to do transparency masking on the fly, I have an article up at the WDJ site on how to do it as well, or if you're not targetting W95 you can use TransparentBlt ( you'll need do download the SDK if you don't have it ).
If you use GDI+, you don't need GIF, it also has transparent drawing built in.
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
|
|
|
|
|
What's the proper way of assigning a STL string value to an MFC CString or vice versa? Can you do that?
|
|
|
|
|
CString str;
std::string x;
str = x .c_str ();
x = (LPCTSTR) str;
That should work.
|
|
|
|
|
CString mfcStr;
string stlStr;
mfcStr = stlStr.c_str;
stlStr = /*(LPCTSTR)*/mfcStr;
*** Alphose from OZ ***
|
|
|
|
|
Hi,
I am newbie writing a small SHAREWARE program.
I want to control my software with time limts.(Ex: 30 days, or 2 weeks or Turn off some features after 30 days)
How to accomplish that?
I appreaciate any information regarding this.
thanks
Ravi
|
|
|
|
|
You can get the current time at setup and save it to file or reg and to check if in time limited range get the current time at program runtime substracted by the time in the file. The result should be less than the time limited range. All time will be in the format of the number of millseconds since 1/1/70(i think it 1970) and the results is just in millseconds.
Real World Coding:
POP& BuyAPop(Money ADollar){...};
|
|
|
|
|
Looks like good idea.
I have one more question, as I am exploring other options too..
How some shareware programs work with checking serial numbers logic. Ex: If you enter the code, it will go and check at their website, is that number legit or not.
thanks
Kant
|
|
|
|
|
Most shareware progs that ask you to enter a regcode have some kind of algorithm to check if its a valid serial number. Actually ther's not much pointing in writing a complicated function because for a cracker it just adds to the fun.
Nish
|
|
|
|
|
Actually ther's not much pointing in writing a complicated function because for a cracker it just adds to the fun.
Why not, I have made some pretty complicated algoritms for my serial numbers. Why make it easy for the crackers?
If they wanna crack one of my applications, they have to be good and work for it.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
They'll just crack out your serial-number algorithm.
If I had to write a demo-version I would write one WITHOUT the limited code so that nobody could crack it but order
|
|
|
|
|
I'm having difficulty getting my VC6.0++ ATL->ActiveX Server Object EVENTS to show up in Intellisense (all other methods show up).
*I made sure ConnectionPoints were checked when i made the object, so I have an _IFunkyEvents Implementation thingy
*I right clicked on my "CFunky" and clicked "Implement Connection Points", which made a CProxy_IFunkyEvents<class t="">
*I added events to _IFunkyEvents, I compiled before I tried to "Implement Connection points", and then I did it, and I would recieve an error about:
;;CONNECTION_POINT_ENTRY(IID__IFunkyEvents)
*I changed IID__IFunkyEvents to DIID__IFunkyEvents and that stopped that error... <shrug>
Is this a "common stupidity thing"? Any clues as to what I'm doing wrong when I'm going through those wizards?
SHABBA!!
|
|
|
|
|
Microsoft has documented that as a bug in the wizard.
Thanks for the help,
Bill
|
|
|
|
|
Hey Guys
Does anyone know why i would get these errors all i have done is create a dialog with a tree view.given the treeview a variable and added an image list.
F:\Development\C++\Programs for Companys\Trustis\Software to Sign and Verify Files\ViewSigners.h(22) : error C2146: syntax error : missing ';' before identifier 'm_tSignersView'
F:\Development\C++\Programs for Companys\Trustis\Software to Sign and Verify Files\ViewSigners.h(22) : error C2501: 'CTreeCtrl' : missing storage-class or type specifiers
F:\Development\C++\Programs for Companys\Trustis\Software to Sign and Verify Files\ViewSigners.h(22) : error C2501: 'm_tSignersView' : missing storage-class or type specifiers
F:\Development\C++\Programs for Companys\Trustis\Software to Sign and Verify Files\ViewSigners.h(36) : error C2146: syntax error : missing ';' before identifier 'm_imageList'
F:\Development\C++\Programs for Companys\Trustis\Software to Sign and Verify Files\ViewSigners.h(36) : error C2501: 'CImageList' : missing storage-class or type specifiers
F:\Development\C++\Programs for Companys\Trustis\Software to Sign and Verify Files\ViewSigners.h(36) : error C2501: 'm_imageList' : missing storage-class or type specifiers
F:\Development\C++\Programs for Companys\Trustis\Software to Sign and Verify Files\ViewSigners.cpp(31) : error C2065: 'm_tSignersView' : undeclared identifier
F:\Development\C++\Programs for Companys\Trustis\Software to Sign and Verify Files\ViewSigners.cpp(50) : error C2065: 'm_imageList' : undeclared identifier
F:\Development\C++\Programs for Companys\Trustis\Software to Sign and Verify Files\ViewSigners.cpp(50) : error C2228: left of '.Create' must have class/struct/union type
F:\Development\C++\Programs for Companys\Trustis\Software to Sign and Verify Files\ViewSigners.cpp(51) : error C2228: left of '.SetImageList' must have class/struct/union type
F:\Development\C++\Programs for Companys\Trustis\Software to Sign and Verify Files\ViewSigners.cpp(53) : error C2228: left of '.InsertItem' must have class/struct/union type
F:\Development\C++\Programs for Companys\Trustis\Software to Sign and Verify Files\ViewSigners.cpp(53) : error C2059: syntax error : ')'
Error executing cl.exe.
cheers
Peter
|
|
|
|
|
You havent included afxcmn.h . Pop in in stdafx.h
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Cheers i suspected it wouldbe something simple like that.
|
|
|
|