|
use "unsigned __int64" for the math, then break it apart when you need to store it?
-c
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'.
--Holgate, from Plastic
|
|
|
|
|
I tried something like that, Chris, but the compiler whined so painfully I felt sorry for it and gave up.
I tried creating an accumulator of type ULARGE_INTEGER for the 64-bit value. I then tried setting it equal to the high part of my dword, then shifting the whole thing left by 32 bits, and adding the low part. VC6 told me that "=" wasn't defined. Hmmmm. Go figure. According to the PSDK, unsigned_int64 should be the same as ULARGE_INTEGER, but apparently it isn't. This should be a no-brainer; all I'm trying to do is add an arbitrary number of milliseconds to a FILETIME structure. For safety, I've even limited the range of values for the offset to a long value - I don't dare try tackling the truly generic case yet.
Is there a Visual ASM.NET? Maybe I'd be more comfortable playing with that...
"My child was Inmate of the Month at Mohave County Jail" - Bumper Sticker in Bullhead City, AZ
|
|
|
|
|
Roger Wright wrote:
VC6 told me that "=" wasn't defined.
Did you try assinging to the QuadPart field of the ULARGE_INTEGER? I know that is defined for __int64 operations, since it resolves to ULONGLONG and ultimately unsigned __int64.
|
|
|
|
|
hi,
Whats the best method to distribute mfc apps.
Static or shared ?
thanks
Hari Krishnan
|
|
|
|
|
I prefer static over shared for small applications just to avoid the dll version problems. But I havent developed any huge applications running to several megabytes, in which case shared dll may be a good idea.
Cheers
Kannan
|
|
|
|
|
Static, undoubtedly.
1) You insulate yourself from reliability problems caused by older or newer versions of the MFC DLLs floating around in the system.
2) You end up with a simpler installer.
3) You end up with a smaller distribution package, because the linker throws out the unused MFC code.
|
|
|
|
|
Jim A. Johnson wrote:
3) You end up with a smaller distribution package, because the linker throws out the unused MFC code.
no. if you link against DLL you'r exe is smaller and if you dont distribute the MFC DLLs with your installer you're smaller undoubtfull.
|
|
|
|
|
hi all,
How can i use xp icons (hicolor & anti-aliased) in my toolbar ? i have vc6.
thanks
Hari Krishnan
|
|
|
|
|
Have a look at
this[^]
article.
Cheers
Kannan
|
|
|
|
|
I want to split A View into two in a window.
And i want to know how to get these own point .(using two different CWnd* point to get it )
Thank you !
|
|
|
|
|
You can use CSpitterWnd to split a CMainFrame/CFrameWnd in two. The panes can then be filled with a CView.
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
HI!
In my project I use ODBC to write some entry into Excel and I use ODBC to read them successfully!
But when I write some entry into this Excel by handwork,them cann't be read by the same code!!! why??anybody know?? Tell me quickly! Thanks!
(I am sorry my English is poor!)
|
|
|
|
|
Hi,
I have a custom window,where i had painted caption,border..
It is fine.But if i keep on resizing.my windows goes crasy.
There is no resource leak in my application.
Can any one help me?
Regards
Neha
|
|
|
|
|
Neha wrote:
my windows goes crasy.
How, what happen ?
Max.
|
|
|
|
|
Hi guys,
I need an opinion regarding a problem I have. I'm an university student working for a company in New Zealand, developing an MFC application which communicates, through a serial port, to an external device. The application will then subsequently retrieve data, stores it in a document object, and update all views currently opened.
There could be many views of the data, involving various line plots.
I've written the first version of this application last year, and we found that the lineplot drawing can be very intensive, the User Interface becomes very slow to respond to user clicks, etc. I've looked at maximising the drawing calculations, but there's simply not much I can do to improve it further.
The boss surely enough doesn't like this ^^ He wants some improvement made.
At the moment, I'm thinking of creating a UI thread for each separate view. That is, everytime user wnats to open a new, say line plot, a new UI thread will be spawned off and in turn a new frame and view will be created to display the data.
The problem comes about because data will be continually updated, so the thread must have access to the actual document object, and the mainframe menu must continually be adjusted to account for the different view. For example, when the view is a line plot, certain toolbars must appear, which can be quite different from when a table is displayed.
I've been looking all over the net and MSDN for information, but it seems that there is a great reluctance to tackle the multithreaded SingleDocument-Multiple View approach. Nasty, they say =P.
I was wondering if nybody can give me some pointers to creating a multithreaded SD/MV framework.
Thank you very muc h. I would greatly appreciate any help anybody can give me.
|
|
|
|
|
Okay,
No replies.. either nobody have any idea, or my post is just plain silly.
REgardless, I've been corresponding with Michal Mecinski, the author of a really good article about MSDI applications, which can be found at http://www.codeguru.com/doc_view/msdi.html[^].
This is what he's got to say about my problem:
Hello,
I've been searching the MSDN for some info and din't find much about multithreaded doc/view applications. The only solution I found was to go trough the MFC source code and experiment with various solutions.
The application you described sounds more complicated to me. I guess the whole document and view classes would have to be completely rewritten.
But I have a different idea. You may create a worker thread for each view, that draws the line plot on a bitmap in memory. The view would need to send a message to the working thread whenever the data is updated. You can copy the data for each thread or let the threads access the data in the document directly (using a semaphore of course). The working thread should actually have two bitmaps - one being displayed in the view (simple BitBlt) and one being drawn by the worker thread. After the plot is drawn you switch the bitmaps and post a message to the view to redraw itself. I think this is much simpler than using multiple UI threads. I used such solution once in an application that was drawing fractals and it worked perfectly. I hope this might help.
Regards,
Michal Mecinski
Any comments, folks?
Two Rivers!
|
|
|
|
|
Hello all,
I've got a .dll project that's an ATL Composite object, and am using MFC. When I build the dll to work w/ MFC in a Static library, everything works fine when I run it. When I build the dll to work w/ MFC in a Shared Library, my resources aren't found & things don't work when I run it. (AfxGetResourceHandle() returns NULL, various assertions, dialogs not created, etc). Can anyone shed a little light on the matter? How can I fix it so that I can build it against the shared MFC library & have things working ?
Thanks!
Wes
CPUA - # 0xd00d
Sonork ID 100.14017 wtheronjones
|
|
|
|
|
Hi,
Did you ever figure this out? I just ran into this problem... It started happening out of nowhere, and I'm not sure what I changed to get this to fail...
Cheers,
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
hello @all,
i have an mfc program and an access database. i connected them with odbc.
how can i make the following sql statement in my mfc programm?
'select distinct xy from mytable'
thank you very much.
mfc
|
|
|
|
|
Use CRecordset Open() member function.
|
|
|
|
|
thanks for reply, but it does not work. somewhere i make a mistake.
i want to read out 'xy' from a table 'mytable' and put these CString into a ComboBox:
Now i tried this:
<br />
CMyDatabase db;<br />
db.Open( CRecordset::dynaset,<br />
_T( "Select distinct xy from mytable" ) );<br />
<br />
db.MoveFirst();<br />
while(!db.IsEOF())<br />
{<br />
m_ctrlCombo.AddString(db.m_xy);<br />
db.MoveNext();<br />
}<br />
db.Close();<br />
UpdateData(false);<br />
i get the error, when i want to use this funktion. the error:
error with the call of a data record
thanks
mfc
|
|
|
|
|
you can use some SQL tools(such SQL Server's Query Analyzer) which can chech you SQL statement, go, if you SQL statement is right that you can see the result for you query.
My English is not good, but I can try my best for your problem.
hi
|
|
|
|
|
In my MFC dialog program, the main dialog is a property sheet, with various property pages. When the dialog is open, I want my program to do something special when the user presses (and releases) the space bar. Currently, I'm catching the WM_KEYUP message in my property sheet's PreTranslateMsg function, and returning true if the key is space (the OnKeyUp function doesn't work for some reason). Unfortunately, pressing space also activates the currently selected button, which I definitely don't want. How do I get around that?
Thanks!
|
|
|
|
|
I would say, you should override the OnKeyDown() function instead.
Within that function, check the nChar parameter, and if it is the keyboard button, do your thing, then exit without calling the base class implementation. Or call the baseclass implementation, but change the value of nChar to somnething else that wouldn't be a problem for you.
Get back to us on that, please.
Two Rivers!
|
|
|
|
|
I wasn't able to get my OnKeyUp/Down functions working (in the sheet OR page), so I'm just catching the WM_KEYUP/DOWN in PreTranslateMsg in the sheet.
I finally got it working, by returning true (that function) if the key was pressed down, and by performing the action when the key was released. I thought I tried that before, but oh well
Thanks for the reply!
|
|
|
|