|
Am not sure if this might help, but it need a good Assembly programmer(I barely know it myself).
This is how VC++ implement the __int64 using Assembly, remember that all processors register are 32 (except 64 bit CPU of course) and all operations are done on them at the processor level.
Anyway these are C++ statements with corresponding Assembly, it you may be able to implement using Assembly.
__int64 l1, l2, l3;
l1 = 256;
00417053 mov dword ptr [l1],100h
0041705A mov dword ptr [ebp-14h],0
l2 = 128;
00417061 mov dword ptr [l2],80h
00417068 mov dword ptr [ebp-24h],0
l3 = l1 + l2;
0041706F mov eax,dword ptr [l1]
00417072 add eax,dword ptr [l2]
00417075 mov ecx,dword ptr [ebp-14h]
00417078 adc ecx,dword ptr [ebp-24h]
0041707B mov dword ptr [l3],eax
0041707E mov dword ptr [ebp-34h],ecx
l3 = l1 - l2;
00417081 mov eax,dword ptr [l1]
00417084 sub eax,dword ptr [l2]
00417087 mov ecx,dword ptr [ebp-14h]
0041708A sbb ecx,dword ptr [ebp-24h]
0041708D mov dword ptr [l3],eax
00417090 mov dword ptr [ebp-34h],ecx
l3 = l1 * l2;
00417093 mov eax,dword ptr [ebp-24h]
00417096 push eax
00417097 mov ecx,dword ptr [l2]
0041709A push ecx
0041709B mov edx,dword ptr [ebp-14h]
0041709E push edx
0041709F mov eax,dword ptr [l1]
004170A2 push eax
004170A3 call @ILT+1330(__allmul) (411537h)
004170A8 mov dword ptr [l3],eax
004170AB mov dword ptr [ebp-34h],edx
l3 = l1 / l2;
004170AE mov eax,dword ptr [ebp-24h]
004170B1 push eax
004170B2 mov ecx,dword ptr [l2]
004170B5 push ecx
004170B6 mov edx,dword ptr [ebp-14h]
004170B9 push edx
004170BA mov eax,dword ptr [l1]
004170BD push eax
004170BE call @ILT+5340(__aulldiv) (4124E1h)
004170C3 mov dword ptr [l3],eax
004170C6 mov dword ptr [ebp-34h],edx
l3 = l1 % l2;
004170C9 mov eax,dword ptr [ebp-24h]
004170CC push eax
004170CD mov ecx,dword ptr [l2]
004170D0 push ecx
004170D1 mov edx,dword ptr [ebp-14h]
004170D4 push edx
004170D5 mov eax,dword ptr [l1]
004170D8 push eax
004170D9 call @ILT+5345(__aullrem) (4124E6h)
004170DE mov dword ptr [l3],eax
004170E1 mov dword ptr [ebp-34h],edx
there are some function for multiplication and division, but I could not get their code.
|
|
|
|
|
Hi,
I'm overriding the WM_NCLBUTTONDOWN event for my dialog. I found out that I need to send the WM_SYSCOMMAND message so the buttons (min,max,close) still work. Everything is ok but when I want to resize, the cursor is moved at the center of the dialog so it's nearly impossible to resize the window.
What I am doing wrong???
Thanks!
LRESULT CBlankDlg::OnNcLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
if( GetAsyncKeyState( VK_LCONTROL ) || GetAsyncKeyState( VK_LCONTROL ) )
{
INT i=0;
}
LONG msg;
switch( wParam )
{
case 2:
msg = SC_MOVE;
break;
case 20:
msg = SC_CLOSE;
break;
case 9:
if( m_isMaximized )
{
m_isMaximized = FALSE;
msg = SC_RESTORE;
}
else
{
m_isMaximized = TRUE;
msg = SC_MAXIMIZE;
}
break;
case 8:
m_isMaximized = FALSE;
msg = SC_MINIMIZE;
break;
case 17:
msg = SC_SIZE;
break;
}
SendMessage( WM_SYSCOMMAND, msg, lparam );
return 0;
}
---------------
Tired of Spam? Introducing InboxShield® for Microsoft® Outlook®
http://www.edovia.com
|
|
|
|
|
How do you remove the default icon that appears in the upper left hand corner of a child frame window on the title bar in an MDI style application?
LIFE IS COOl
|
|
|
|
|
It's an icon in your app. You can change it.
Also, when you create the window you can adjust the create struct to not include the app icon. CS_something.
|
|
|
|
|
Remove the WS_SYSMENU style from your window. Keep in mind that this will also disable Alt-Space as well.
--Mike--
The Internet is a place where absolutely nothing happens.
-- Strong Bad
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I have a static library I have compiled with VS.Net -- the library compiles correctly. However, when I try to link against it I get link errors for multiply-defined symbols such as:
CWPDataManager error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::operator+=(char)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z) already defined in MyDateD.lib(MyDate.obj)
My library makes use of std::string (as you can see above) and I've put the approriate #ifndef include guards in the library .h file. So, why do I get these link errors when I build my app and link against my libray? Anyone know where my problem is?
Thanks,
--Dean
|
|
|
|
|
Are there functions in the DLL that returns a pointer or reference to a string object? If so, one solution is to do return by value.
Kuphryn
|
|
|
|
|
Well, it's not a DLL - it's a static library. I have one function that takes a string by reference (consequently this is where the link errors arise from -- it's the only function that uses string). The function return is void and the string that is passed by reference is modified within the function.
The function (inside the library) looks like this:
void CMyClass::format(const char* fmt, string& dest)
{
...
(modify dest)
...
}
--Dean
|
|
|
|
|
Okay.
See if you can pass in a const string and return the modified string instead of void.
Kuphryn
|
|
|
|
|
That's usually caused by the build settings for the LIB using one form of CRT linking (static or DLL) and the executable using the other.
--Mike--
The Internet is a place where absolutely nothing happens.
-- Strong Bad
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
in my OnPaint, i am drawing to a memory DC, then blitting to the screen. if i do memDC.DrawFocusRect(...), then Blt, the rectangle turns out light blue (ie. wrong). but if i Blt then draw the focus rect onto the screen DC, it comes out black-and-white dashed (as it should).
memDC.DrawFocusRect(CRect(10,10,100,100));
dc.BitBlt(frameRect.left, frameRect.top, frameRect.Width(), frameRect.Height(), &memDC, 0,0, SRCCOPY);
memDC.SelectObject(ob);
dc.DrawFocusRect(CRect(10,10,100,100));
-c
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
play around with SetTextColor and SetBkColor for that device, i'm not exactly sure which parameters you'll need but changing those affects the focus rect
- Roman -
|
|
|
|
|
Is the mem DC's setup exactly the same as the screen DC?
|
|
|
|
|
i think it is...
CPaintDC dc(this);
CDialog::OnPaint();
CDC memDC;
if (memDC.CreateCompatibleDC(&dc))
{
CBitmap bmp;
if (bmp.CreateCompatibleBitmap(&dc, frameRect.Width(), frameRect.Height()))
{
CBitmap *ob = memDC.SelectObject(&bmp);
if (ob)
{
... draw the stuff in here
-c
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
This suggestion may be silly, but worth the try: initialize the memDC before calling CDialog::OnPaint() . Something like:
CPaintDC dc(this);
CDC memDC;
BOOL bCreated = memDC.CreateCompatibleDC(&dc);
CDialog::OnPaint();
if(bCreated)
{
...
}
Good luck!
|
|
|
|
|
Try this int the Blt SRCINVERT
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
how do i make it so that i can display mathematical equations with symbols like square root, pi, fractions, etc. in my programs?
i know of Microsoft Equation Editor, but i cannot find an SDK for it nor can i insert it as a component in VB.NET. it would also be nice to do this in C++
if any of you know how, or know of other equation displaying packages available, please reply or send me an email
- Roman -
|
|
|
|
|
Roman Nurik wrote:
how do i make it so that i can display mathematical equations with symbols like square root, pi, fractions, etc. in my programs?
You write a layout engine for a word processor...
No, I'm serious. This is heavy layout stuff, not something I'd expect "just anyone" to get right.
If you just want to "do" this, I'd say your best bet is something like LaTex.
++luck;
|
|
|
|
|
|
Hi, folks!
I want a combobox that will always display the same items regardless of where I use it, so I thought about having it be its own class, inheriting from CComboBox. Rather than remember to add the items to it in the InitDialog function for each dialog box I use it in, I want the list to fill itself when it gets created. That way, I can drop a combobox onto a dialog, then change its type from CComboBox to CMyComboBox in the class header and I'm good to go.
So, at what point in the combobox's creation sequence is the best place to put my loading function? (I'm hoping the answer will be something analogous to the InitDialog override for a dialog box class.)
(To clarify things a bit, I'm loading the list from a file, so I can't create the list items in the Resource editor.)
Thanks!
Jesse
|
|
|
|
|
Why not override OnCreate for this? Let the base class handle the initialization chores and, on return, you will have a created window ready to accept AddString s.
|
|
|
|
|
Hmmm... Well, that doesn't seem to work.
I used ClassView to add a Windows Message Handler for WM_CREATE to my new ComboBox class, but the function never gets called.
M$VC added the following to my header:
protected:
//{{AFX_MSG(CRosPartNumberCB)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
and the following to the source:
BEGIN_MESSAGE_MAP(CRosPartNumberCB, CComboBox)
//{{AFX_MSG_MAP(CRosPartNumberCB)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRosPartNumberCB message handlers
int CRosPartNumberCB::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CComboBox::OnCreate(lpCreateStruct) == -1)
return -1;
AddString ("This is a test");
SelectString (-1, "This is a test");
return 0;
}
yet, a breakpoint on the above handler function never trips.
What am I missing here to get the connection established?
Jesse
|
|
|
|
|
If you are using the control in a dialog, the WM_CREATE message is not sent to controls created with a dialog template. You have to override the PreSubclassWindow() function and do your initialization there. Or better yet, have an initialization function that you call from both OnCreate() and PreSubclassWindow() , that way your control will work both ways.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Learning is a continuous process. Thanks, PJ.
|
|
|
|
|
PJ,
Thanks for the insight! Yes, I was using the control in a dialog template. After overriding the function you mentioned, all is working as I wished.
Jesse
|
|
|
|
|