|
hi, thanks for you reply
can you please write me some source codes please, i'm a bit confused...
Ehsan Behboudi
|
|
|
|
|
I have a treelist view. (reused the class from Gerolf @ http://www.codeproject.com/treectrl/treelistctrlgerolf.asp)
When I edit the value (thus the label) of a list item, the value of its parent/ child item are also affected. these values are update din the document but not in the tree view. Only the change in the selected item is updated, not the parent or child item.
How can I make sure that all the affected list items labels are updated accordingly. If you have a sample code, it woudl be wonderful.
Thanks!
|
|
|
|
|
Hi
I have a problem with register ("Regsvr32.exe MyServer.dll") my automation server in Win98 NOT SE(In Win98 SE - succeed)
LoadLibrary return Error Code 31 :
"A device attached to the system is not functioning"
Thanx.
Ernst.
|
|
|
|
|
Hi,
I have two questions:
1-I have a SDI application, and I like to name is "TurboMech", I like to know how can i
have that name on top of the mainframe everytime i run the program.
i used the following code but it does work
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
Create(NULL,"TorboMech",WS_OVERLAPPEDWINDOW,rectDefault,NULL,NULL);
}
2-How can i get the file name (bmp file), beside the application name when i rn the program.
Thanks
Ehsan Behboudi
|
|
|
|
|
You should find the following to help.
1) Create a function "UpdateTitle" in your document class in which you set the document title to whatever you like.
eg. "TurboMech - Filename.bmp"
2) Override the OnUpdate(...) function of your view at the end of which call GetDocument->UpdateTitle()
Note: You can check the modified state of the Document and add a "*" at the end of the new title if it has been modified since the last save.
Hope this has been of some help...
Paul McLeish, Senior Software Engineer
BELTEK, Inc
Email: paul@beltek-linkone.com
|
|
|
|
|
thaks for you reply,,
in my UpdateTitle() function, how can i initialize the title???
Thanks
Ehsan Behboudi
|
|
|
|
|
The CDocument function SetTitle(sNewTitle) will allow you to set this.
Note: Your Document's UpdateAllViews should be called on initial update or by your app when you change data, which in turn calls your Views OnUpdate.
Paul McLeish, Senior Software Engineer
BELTEK, Inc
mailto:paul@beltek-linkone.com
|
|
|
|
|
What is the best way to close (i.e., destroy) a view from its OnUpdate operation?
I don't want to close the document.
Currently, I am aware of the following options. I am not sure if they'd all work, or which would work best.
1. CDocument::RemoveView()
2. Post WM_CLOSE
3. Post WM_DESTROY
Any help is much appreciated.
Marc
|
|
|
|
|
|
How can I change the value of my document data from another class?
in my sample MFC code in MyProjectView.cpp:
...
...
CMyObject* pPencil = GetDocument()->m_pPencil;
// the value of GetDocument()->m_pPencil->Length is 0
pPencil->Length = 2;
...
...
somehow when I execute this code, the value of m_pPencil->Length in the document is still 0. how can I change the document data from my project's View class?
|
|
|
|
|
Try this:
CMyView::
{
GetDocument()->m_pPencil->SetPencilLength( 1 );
}
or, even better, as the document should be responsible for managing the data defined within it
(as with any well designed object class )
CMyView::
{
GetDocument()->SetPencilLength( 1 );
}
CMyDocument::SetPencilLength( int length )
{
ASSERT( NULL != m_pPencil ); // And other appropriate checks!
m_pPencil->SetPencilLength( length );
}
|
|
|
|
|
Okay I'm trying to regulate how many messages get sent out of my Outlook box at once...now would it be easier to monitor some MAPI call? Or should I write a small "exchange agent" to do this??
I was HOPING to write a small piece of code that I could run as an NT service that would run independently of the email client..
Does anyone have any suggestions???
thanks in advance,
Erik
I hit faked him with my win32 API .chm and the peabrain goes for it. I follow it up with a salvo of left's and right's sending him down hard. It's lunch time and he's getting a Champ Sandwhich Special. I said, How's that Mr. VB?! Is that 'I wanna use COM in that Server enough for you?!'
...Ever since then, I've been the Champ.
|
|
|
|
|
Okay did some more perusing of the MAPI docs and found what I think I needed...a MAPI pre-processor DLL component which intercepts the messages before they hit the mail transport provider..
Has anyone here had any experience programming these MAPI preprocessor guys??
thanks again,
Erik
I hit faked him with my win32 API .chm and the peabrain goes for it. I follow it up with a salvo of left's and right's sending him down hard. It's lunch time and he's getting a Champ Sandwhich Special. I said, How's that Mr. VB?! Is that 'I wanna use COM in that Server enough for you?!'
...Ever since then, I've been the Champ.
|
|
|
|
|
Hi.
I need to access not only the sent data but the whole IP packets to analyze the headers (for a firewall-like app).
My problem is, that I can't find any entry point in the MSDN to learn about access to the low level network traffic.
How can I
1. get notified when a packet arrives ?
2. get the packet form the queue ?
3. put packets into the queue ?
I'd be happy to learn about a good website/tutorial about this issue...
|
|
|
|
|
You have to write a packet driver. To do that you need the DDK (Driver Development Kit) for win9x. (download from MS)
There is a demo driver, in the DDK, that can do a lot of the things that you want
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hello,
I seem to be having a problem with my message queue. I am working on a data aquisition app (multi-threaded). The data aquisition thread(s) post messages to the MFC gui thread when data is received and when the graph needs to be refreshed. Occasionally, the graph stops displaying data until the refresh occurs (rather than as it is received). When this happens, all of the buttons in the dialog become inoperable. Is there a way to do something with the message queue? I'd like to be able to see if it's getting full and, perhaps, increase its size.
Thank you.
Paul Ebert
|
|
|
|
|
Hi.
Perhaps you should try to prevent the message queue from getting overload.
I assume you don't need more than a few refreshs in a second?! So you can implement a global thread-safe bool which
- is set when a message is sent to the GUI.
- is reset by the paint reoutine after completion.
The threads only send a refresh request, when the bool is not set.
Hope it will help you.
Karl
|
|
|
|
|
In Windows 3.1 there was SetMessageQueue function that made increasing the queue size possible, but it's obsolete now - they probably made it a no-op call.
Do you really have to post multiple messages from data acquisition thread? Before posting you could check if GUI is already refreshed. If not, no need for second PostMessage.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
If you need a utility that generates a windows help file automatically from
a type library, you might want to take a look at Oberon TLB Tools utility:
http://www.vakcer.com/oberon/products/tlbtools/
This utility includes 3 tools:
TLB2HLP - generates a complete WinHelp project containing .rtf, .cnt, .prj,
and other files ready to be compiled into a .hlp file. The .rtf file
contains help topics on each objects, method, properties, etc. with
descriptions, place holders for code samples, etc. A good start to create
full online help for a COM object model or ActiveX control properties.
TLB2HTML - creates an HTML file containing all type information from a type
library with cross-references, object index, and so on...
TLB Compare - compares two type libraries and writes differences as an HTML
file.
You can find examples of how each of the tools work on the web page given
above...
I hope this is helpful...
--
Alex
----
Do you still use a stopwatch to track your project time?
Why not try a completely automatic time tracking and billing
application for Windows - VAKCER Project Tracker v2.1?
Get your free trial copy today at http://www.vakcer.com
|
|
|
|
|
I am interesting in using Mr. Naughter CCPUTicker, but I want to use it as accurately as possible.
Is there a way to place a "lock," something like a semaphore, around a set of C++ instructions, and stop all other messages from being serviced during this time?
In other words, can I change
foo(a);
bar(b);
to
BEGIN(lock)
foo(a);
bar(b);
END(lock)
and know that foo and bar were executed sequentially? For CCPUTimer, this would allow me to time between to calls as accurately as possible.
Thanks,
Ryan
|
|
|
|
|
Remember that 32-bit Windows systems use preemptive multitasking. You can't ensure that your process is utilizing all CPU resources all the time.
You can of course ensure that other thread from your process is not called during foo and bar. Is your application multithreaded?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
No, I am not using a multithreaded application.
Would CWinThread::SetThreadPriority(THREAD_PRIORITY_TIME_CRITICAL) be the closest I could get to locking out the other processes? I realize windows is not a RTOS, but thought it might be possible to force a process to "utilize all CPU resources" for a short time.
-Ryan
|
|
|
|
|
Yeah, SetThreadPriority and SetPriorityClass will make your process real resource hog
If your app is singlethreaded, don't worry about message pump - it's running in the same thread. Just don't call PeekMessage/GetMessage manually inside foo and bar.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hmmm... I'm looking at Richter's Advanced Windows, chapter 4, and it looks like if you were to get really piggy you could SetPriorityClass for the process to REALTIME_PRIORITY_CLASS and SetThreadPriority to THREAD_PRIORITY_TIME_CRITICAL to give it a level of 31.
31 is the maximum. 31 is extreme. 31 will never yield. 31 can alter the fabric of the space time continuum as we know it.
Well, thats the impression I get anyway.
On NT you'll need the Increase Scheduling Priority privilege.
|
|
|
|
|
I have been programming C++ for about a year, and have learnt quite a lot. However, moving to Visual C++ has really created problems for me. I understand most things, I can deal with messages properly, interact with UI elements etc, but it still seems a long way off that I would be able to put together a complex application or game. How did you guys learn, and what is the best way for me to go from here?
|
|
|
|