|
I am looking for big prime numbers generator (class,function,code). Big I mean at least 100 digits.
Thanks in advance.
|
|
|
|
|
This has some bigint prime generators.
http://www.eskimo.com/~weidai/cryptlib.html
Regards,
Alastair.
|
|
|
|
|
Hi
I'm having some problems with using the SetWindowsHookEx function to intercept menu messages so I can draw the menu border myself when necessary. I've taken a look at sources of other ownerdraw menus already, but I'm still having problems. Could someone please explain me the procedure for setting up appropriate hooks so that I end up with menu message calls like WM_NCPAINT etc.
Thanks in advance.
|
|
|
|
|
Hi
The member 'LParam' of the HDITEM structure can contain "Application-defined item data".
I've set the lParam = "TEXT";
It's accepted, and i added the new HDITEM structure to the CHeaderCtrl with some other members filled in of that structure.
In another function, i read the HDITEM like this:
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
HDITEM MyItem;
MyItem.mask = HDI_TEXT;
pHeader->GetItem(nCol, &MyItem); //Krijg het item-info door
CString temp;
temp.Format("%s", MyItem.lParam); // temp = MyItem.lParam doesn't work neither
but i can't receive the lParam well ... anyone knows the problem?
Greetings
Jens
|
|
|
|
|
You have two errors. First you do not add the PARAM mask when you query for the item (in the mask member of HDIITEM) and you set text to the lparam that is located on the stack which is gone when you go out of scope.
Use something like MyItem.lParam = (LPARAM) strdub(yourstring) to attach text to the lparam. Note that you have to delete it later to avoid memory leaks!
|
|
|
|
|
Note that you have to delete it later to avoid memory leaks!
Were you talking about the 'MyItem'? I don't c why it should be deleted
|
|
|
|
|
// See code for an example:
void FillHeader()
{
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
HDITEM MyItem;
pHeader->GetItem(nCol, &MyItem);
MyItem.mask = HDI_LPARAM; // was: HDI_TEXT;
myItem.lParam = (LPARAM) strdup(szYourString); // make a copy of your string on the heap!
pHeader->SetItem(nCol, &MyItem);
}
void UseLPARAM()
{
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
HDITEM MyItem;
MyItem.mask = HDI_LPARAM; // was: HDI_TEXT;
pHeader->GetItem(nCol, &MyItem);
CString temp((LPSTR)MyItem.lParam);
}
Here a copy is made of the text you like to attach to the lParam member if HDITEM (strdup).
It returns a pointer to a copy of your string. This pointer is stored in the lParam.
Because a copy is made, you need to delete the string with free when the header control
is not used anymore.
Hope this helps....
|
|
|
|
|
The mask member indicates which other items in the HDITEM struct are being used, so you need to set it to HDI_LPARAM and init the struct to all 0's:
HDITEM MyItem = {0};
MyItem.mask HDI_LPARAM;
...
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Hello.
I need a little help.
What is it about...
I have a project in which im using ADO. So i import an ado dll like that :
#import "c:\Program Files\Common Files\system\ado\msado15.dll" no_namespace rename("EOF", "adoEOF")
its ÎÊ
But i need to use and AdoX
so in one help ( in MSDN ) i saw that code and i used in py project:
#import "c:\Program Files\Common Files\system\ado\msado15.dll"
#import "c:\Program Files\Common Files\system\ado\msadox.dll" no_namespace
Super, but it does not work:
--------------------Configuration: s - Win32 Debug--------------------
Compiling...
StdAfx.cpp
\my_source\s\debug\msado15.tlh(409) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
\my_source\s\debug\msado15.tlh(1317) : error C2629: unexpected 'short ('
\my_source\s\debug\msado15.tlh(1317) : error C2238: unexpected token(s) preceding ';'
\my_source\s\debug\msadox.tlh(1201) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
Error executing cl.exe.
s.exe - 2 error(s), 2 warning(s)
////////////////////////////////////
when i click on the error it goes to the source file on this line: VARIANT_BOOL EOF;
I tried various ways, to change places of the no_namespace rename("EOF", "adoEOF") è no_namespace
but there is no any result, just gives me other errors.
So if anyone knows how it would work ill be glad to tell me.
Thank you in advance.
|
|
|
|
|
try this that I use on all of my ado projects (declared in stdafx.h):
<br />
#pragma warning(push)<br />
#pragma warning(disable:4146 4192)<br />
<br />
#import "C:\Program Files\Common Files\system\ado\msadox.dll"<br />
#import "C:\Program Files\Common Files\System\ado\msado15.dll" rename ("EOF","ADOEOF")
#import "C:\Program Files\Common Files\system\ado\msjro.dll" rename_namespace("JRODB")
<br />
using namespace ADODB;<br />
#pragma warning(pop)<br />
I have included the JRO libraries, but you can comment those out if not being used.
Richard.
|
|
|
|
|
If you look at your #import s, then you can see that you don't rename EOF in msado15.dll like you do with the EOF in msadox.dll.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Decision is:
<br />
#pragma warning (disable: 4146)<br />
#import "d:\Program Files\Common Files\system\ado\msadox.dll" rename_namespace("ADO_X") rename("EOF", "adoEOF")<br />
#import "d:\Program Files\Common Files\system\ado\msado15.dll" no_namespace rename("EOF", "adoEOF")<br />
so where you need to use an adoX you can type: using namespace ADO_X.
)
thanks for help
|
|
|
|
|
Hi, I am sorting a list of string using STL list's sort() function. It is performing well only if list contains less than 32768 records. But what if records exceed more than this ?
Can anybody help me. ????
Thanxs a lot.
C.R.Naik
|
|
|
|
|
I assume you are using MSVC6 and haven't applied the bugfixes.
|
|
|
|
|
Which open source diff source code is the best to use?
I tried a few and i'm having trouble, some just won't compile under VC++6
(sorry i didn't ask this in last nights question - it slipped my mind).
Thanks very much.
Colin
|
|
|
|
|
There are several diff articles here on CP you can look at. LCS is probably the best approach.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
|
I think that's a bit advanced for what i need.
I just need source that will output a diff summary when passed two filenames.
any simpler ideas?
thanks!
ps. thanks everyone that has helped me here - I'm getting quite a lot better thanks to your kick starts - cheers
|
|
|
|
|
Hi all!
I need to split my main screen into several panes using the CSplitterWnd. The problem is that I want the different splitter have a fixed size (the user should not resize them).
How can I do it? Is there a specific style for disabling resizing ??
Thanks
|
|
|
|
|
Off the top of my head.
At the very least a frame or pane needs to recieve a WM_SIZE message, use the Visual C++ debugger to find out for sure. If you override these methods/functions/messages you can stop the size of the any window from changing. Do not forget to take into account windows smaller than you expect and or weather the user wishes to minimize the application, also screen resolution may play a part (if it is to big to run in safe mode it is to big).
Trust in the code Luke. Yea right!
|
|
|
|
|
Yes it could be a solution but it's not really what I wanted. I just want the separation between the panes not to be mobile (so, when the mouse arrive on it, the cursor don't change also to a sizeable cursor).
Is it possible to do such a thing?
Thanks
|
|
|
|
|
Use the class wizard to create a CSplitterWnd derive class. Add message handlers for WM_LBUTTONDOWN, WM_MOVEMOUSE, and WM_SETCURSOR. Then do the following:
Replace the defaults:
CSplitterWnd::OnLButtonDown(nFlags,point);
CSplitterWnd::OnMouseMove(nFlags,point);
CSplitterWnd::OnSetCursor(nFlags,point);
With:
CWnd::OnLButtonDown(nFlags,point);
CWnd::OnMouseMove(nFlags,point);
CWnd::OnSetCursor(nFlags,point);
Then use your dirived class in place of CSplitterWnd.
FYI: The above imformation is in the book "The MFC Answer Book" By Eugene Kain. Search for "MFC FAQ".
Trust in the code Luke. Yea right!
|
|
|
|
|
Great !!
That's much more elegant
Thanks a lot
|
|
|
|
|
is there any way to get pixel size from HBITMAP?
(i want to center it into rectangle)
(most often it is loaded by LoadImage - maybe resource pixel size is available?)
t!
|
|
|
|
|
Use GetBitmapDimensionEx to get the dimensions of the bitmap.
|
|
|
|