|
Hi,
I've written a program to test the performances of a windows timer under different work loads. In a first step we used the program under a windows 98 platform with a timer frequency of 5Hz. So every 200msec the Wintimer should sent a WM-TIME message to the OnTimer function. Because the timer tick frequency of a windows 98 platform is about 18Hz(55msec) there will be approximately a time delay of 20msec. When I start the program with no work load(0 floating point operations) the time delay is also 20 msec, so everything is normal. But when I want to increase the work load to 1.000.000 floating point operations the time delay becomes smaller. I would expect that it would increase with increasing work load!
Can anyone explain this?
Kind regards,
Geert
|
|
|
|
|
My semi-educated guess: that your program is getting more scheduled time and can therefore respond quicker to the WM_TIMER message. My guess is that if there was another program consuming more CPU than yours, you might take longer to respond.
Joel Lucsy (jjlucsy@concentric.net)
|
|
|
|
|
I want to capture the packet (that comes to my server application) and display the fields in that packet like source address,destination address e.t.c.
I am using the winsock2 library for my server.
Please help me (if i have declare a struture of TCP,UDP and than capture the packet) with the relevant theory, logic, code or relevant website for achieving my purpose.
Reply me soon
|
|
|
|
|
I want to capture the packet (that comes to my server application) and display the fields in that packet like source address,destination address e.t.c.
I am using the winsock2 library for my server.
Reply me soon
|
|
|
|
|
Hi All
I have an xml which is passed thru a sytlesheet and in the resultant file, two tags IDValue and IDScheme are not properly output.
Could you please help me out !
Thanks
<b>Enclosed - Source XML </b>
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="C:\ExpressPrototypes\Chi Interface Prototype 2\XMLFiles\RegisterPatientResponse.xsl"?>
<gen:RegisterPatientResponse xmlns:gen="http://www.show.scot.nhs.uk/isd/General" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- xsi:schemaLocation="http://www.show.scot.nhs.uk/isd/General CHIRegisterPatientResponse.xsd" -->
<!-- Contains standard patient response header and a patient body which contains the CHI Number -->
<gen:StandardPatientResponseHeader>
<gen:ReturnCode>SUCCESS</gen:ReturnCode>
<gen:ErrorCode>0001</gen:ErrorCode>
<gen:ErrorText/>
</gen:StandardPatientResponseHeader>
<!-- Standard patient response body containing the CHI Number -->
<gen:StandardRegisterPatientResponseBody>
<gen:PatientDetails>
<gen:PatientId>
<gen:IdValue>1601025017</gen:IdValue>
<gen:IdScheme>CHI</gen:IdScheme>
</gen:PatientId>
</gen:PatientDetails>
</gen:StandardRegisterPatientResponseBody>
</gen:RegisterPatientResponse>
<b>Enclosed Source XSL</b>
<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gen="http://www.show.scot.nhs.uk/isd/General" xmlns:req="http://www.isoftplc.com/Express/Chi/RegisterPatientResponse" xmlns:hdr="http://www.isoftplc.com/Express/Chi/Header" exclude-result-prefixes="gen hdr">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="*">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="text()|@*"/>
<xsl:template match="gen:RegisterPatientResponse">
<gen:RegisterPatientResponse>
<xsl:apply-templates/>
</gen:RegisterPatientResponse>
</xsl:template>
<xsl:template match="gen:StandardPatientResponseHeader">
<gen:StandardPatientResponseHeader>
<gen:ReturnCode>
<xsl:value-of select="./gen:ReturnCode"/>
</gen:ReturnCode>
<gen:ErrorCode>
<xsl:value-of select="./gen:ErrorCode"/>
</gen:ErrorCode>
<gen:ErrorText>
<xsl:value-of select="./gen:ErrorText"/>
</gen:ErrorText>
</gen:StandardPatientResponseHeader>
</xsl:template>
<xsl:template match="gen:StandardRegisterPatientResponseBody">
<gen:StandardRegisterPatientResponseBody>
<gen:PatientDetails>
<gen:PatientId>
<gen:IdValue>
<xsl:value-of select="./gen:IdValue"/>
</gen:IdValue>
<gen:IdScheme>
<xsl:value-of select="/gen:IdScheme"/>
</gen:IdScheme>
</gen:PatientId>
</gen:PatientDetails>
</gen:StandardRegisterPatientResponseBody>
</xsl:template>
</xsl:stylesheet>
The values IDValue and IDScheme are not properly output
|
|
|
|
|
Hi,
I'm making a program that have a listview that lays on top of another window(different program). I'd like to show the context menu of the other window. I've tried to send a WM_RBUTTONDOWN message and also WM_CONTEXTMENU, but it doesn't work. Can anybody help me?
I hope my question is clear...
-------------------------------
Greetz,
MG
|
|
|
|
|
MaxiGroovy wrote:
I hope my question is clear...
Well, not really ... What you mean by "show the context menu" ? You want to show the menu items as items in your listview ? Or you simlpy want to open the context menu of the underlying window when your program lays on the top of it ?
~RaGE();
|
|
|
|
|
[quote]Or you simlpy want to open the context menu of the underlying window when your program lays on the top of it ? [/quote]
This one
Just open the context menu of the underlying wnd
-------------------------------
Greetz,
MG
|
|
|
|
|
I think the WM_RBUTTONDOWN should do if you also give the focus to the underlying window, since if the focus directly returns to your own app, the menu vanishes before ever being displayed. So i think you retrieved the hWnd using GetWindow() ? use it to give the window focus, and then send the message.
~RaGE();
|
|
|
|
|
Hey I've got my ListView showing the system icons for each file type, but for directories and a few other files the icon have a black border, instead of the 'transparent' shadow like in IE and others. This is on WinXP, just woundering how I get rid of them? or how to handle them properly, tried searching around and couldn't find anything and the example on CP shows the same 'black borders'.
Luke.
oh yeh I'm using WTL not MFC if that matters.
|
|
|
|
|
when i call PrintDlg with hDevNames set to printer installed at machine what is actually off (driver 'winspool' enabled to select it in previous PrintDlg call but DocumentProperties called after failed)
CommDlgExtendedError returns CDERR_MEMLOCKFAILURE
- all is ok when i set hDevNames to null before call
- when i try to do own GlobalLock to it it makes no problem
seems to me strange solution like:
if CDERR_MEMLOCKFAILURE try to call again with hDevNames=NULL
any experiencies with?
t!
|
|
|
|
|
hi,everybody
Did you use "libxml" to parse your xml file ? I need your help .
how do I parse dtd file by libxml ?
after I parse dtd file ,how do I take use of result for parsing xml file ?
such as ,my dtd file is Goodxml2.dtd
-----------
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT bookshell (book*)>
<!ELEMENT book (author, title)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT title (#PCDATA)>
---------------------------------
my xml fils is Goodxml2.xml
-----------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bookshell SYSTEM "GoodXml2.dtd">
<bookshell>
<book>
<author>Du Peng Chao</author>
<title>Today Story</title>
</book>
</bookshell>
----------------------------------------------
how do I parse dtd file by libxml ? then take use of parsing result to parse xml file for get element content ?
thank you very much
|
|
|
|
|
hiz, i hav a question..
i can already display my database by ADO.
but under 1 section named BIbID it always display 0 i tink it becoz it consist of alphabet N number.
For the rest, it ok because it only contain no.
how do i correct it? thanks
|
|
|
|
|
How can I get application path ?
My condition
1) The Application is already installed on computer
2) The Application is not running.
3) I want to get that application path
sample (acrobat reader, icq, etc...)
1) Acrobat Reader is already installed on computer
2) The Acrobat Reader is not running now.
3) I want to get that Acrobat Reader Path.
How should I do (Howto or Library) ?
Thank you for your kindness.
|
|
|
|
|
I think you have to write SEARCH code.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Well,Let me correct myself.You can do it with WMI.I never use it with VC myself but you can check it in MSDN.Look up Win32_SoftwareElement and Win32_InstalledSoftwareElement .
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Look at the Registry entries.
Look at all the Registry functions in MSDN. With things like RegEnumValue , RegEnumKey , RegEnumValue you should find the application installed, and the path to it (the value in which these are stored are always the same, i.e. Reader should be under Acrobat Registry Key).
~RaGE();
|
|
|
|
|
hi , i have 2 questions.
i need to put an image (200x200) on the top of my dialog box to make it look pretty. I can use any file format to do it, bmp,jpg, gif, im just unsure how to do it. pointers to articles / information on this is appreciated.
also...
I saw an article on here last week by some 'code jock software' etc.. and it was for adding a splash screen to an application... anyone have that link handy?? thanks
josh
todo....
:: insert inpirational text here ::
|
|
|
|
|
The Code Jock guy is Kirk Stowell, you can search for articles by author, he only has a few. Splash screens are pretty easy though, at worst you can just use the component that comes with VC to do it.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
For splash screens, just look at the code of Wordpad in MFC Samples. What is done is :
You create a dialog containing only an image (or whatever) with no border or whatever, which is displayed by the app, and killed in the OnIdle function after a while. Intersting thing is you can display various things (like animations, or plug-in loading à la Acrobat Reader) doing it this way.
I never tried the splash screens in VC++ which Christian is talking about, however, it may be worth a try.
As yor displaying a bmp, with MFC, just create a CStatic somewhere and load a bmp in it. Might also go that way in Win32 API only.
~RaGE();
|
|
|
|
|
you can use BitBlt() and StretchBlt() functions to get the job done and look up MSDN it has some samples on these 2 func's.
BitBlt() just places the bmp on to the dlg and using StretchBlt() u can stretch the bmp to any size u want.
Kapil
Regards,
Kapil
|
|
|
|
|
cool! ! thanks everyone... im going to try to get these things working... the splash screen does sound simple enough. Though I played with CStatic last night and couldnt get the picture to display, i kept getting an error when I tried to load my bitmap ..(16-bit image, is that ok?). ill try documentation on the Bitblt() and StretchBlt to find out more on that task.
thanks,
josh
todo....
:: insert inpirational text here ::
|
|
|
|
|
Hi,
I'm working on a bit of an IM app (connects to msn messenger network) and i'm having a bit of trouble trying to decide how i should go about the message windows. Rich edit controls do nearly everything i need except appending text, the only way i can find of adding text is by keeping a buffer and appending to that then changing the richedit control (i.e. say we have 5k of text in the control and i want to insert a line at the bottom, i have to keep another copy of that 5k of text seperately and effectively wipe the rich text and start over) this method seems like it will introduce flicker and seems a bit of an ugly solution.. any thoughts?
|
|
|
|
|
You can add text to a richedt by "selecting" a null range at the end of the existing text and then "replacing" it with the text that you want to append.
SetSel(-1,-1) and then ReplaceSel() IIRC.
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
I think you've just solved my problem, and you replied 11 minutes after my post, thanks a million.
|
|
|
|