|
Can you give a specific of code form your project.
If you want to assign the parent window, please assign the handle of the main window. But I can be more helpful if you can give sepcific of your code
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
We currently determine if a process is running on the local system by openeing the performance data and scanning the 'process' performance data, searching for the name of the EXE in the performance data. There is some overhead with the various registry-function calls, allocating memory, traversing memory, string compare, etc.
Otherwise, you can call EnumProcesses, which then involves OpenProcess and then GetModuleFileName and searhcing the string.
Has anyone else made such a conversion fromt he registry data to EnumProcesses and then regretted such a change because of performance loss, security issues, or otherwise?
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
i developed a program before to monitor processes, but i can not remomber exact code.
the idea is:
1. use EnumProcess() to find all processes
(there are a few of examples in VC samples)
2. Set a Timer to check changes every 2 seconds.
It may not be what u need.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Thank you for your reply.
I have done what you suggested in other projects as well, and have a fairly substantial class for enumerating the processes already.
However, I am just wondering (without profiling the two techniques myself myself) which of the two techniques I briefly discussed is faster.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Hello,
am still having a problem with this appending. Am recieving data from a machine two times(i,e total lenght of recieving bytes:212) but am recieving them as length:x1 and length:x2)spliting into two chunks.
count:1 //first chunk of data
length:112//length si varying, not constant, say x1
0x65 0x66 0x67......
count:2// second chunk of data
length:100//length si varying, not constant, say x2
0x23 0x40 0x46 0xcf....
How could i append the length of x2 bytes to x1, so that i should have total 212 bytes.
i would be gald if anyone halps me out from this.
BYTE buffer[1024];
BYTE array[1024];//the output data am recieving from machine is in buffer
for(i=0;i<=lLength;i++)
printf("#%x", buffer[i]);
if(count>1)
array[i]=buffer[i];//am assigning all the buffer values to array if count is greater than 1.
"or" i can use memcpy() also, but there si no result;
is it correct?? but i couldnt get append the whole data? could anyone plz help me for appending
-- modified at 12:10 Thursday 9th March, 2006
|
|
|
|
|
chaitanya22 wrote: How could i append the length of x2 bytes to x1, so that i should have total 212 bytes.
Use memcpy() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
if(count>0)
memcpy(array,buffer, 213);
for(int i=0;i<=length;i++)
printf("%x", array[i]);
if i do so, again its copying with chunks in between the data.
as i should copy the buffer of count:2 to buffer of count:1, so am using
array[i+lLength]=lData[i]; //from starting of next chunk
for(int i=0;i<=length;i++)
{printf("%x", array[i]);}
is this correct???
|
|
|
|
|
Consider:
char arr1[12] = "Hello ";
char arr2[6] = "World";
memcpy(&arr1[6], arr2, 5 * sizeof(char));
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yes, Tahnk you for your answer. I got the solution.
|
|
|
|
|
Hi everybody!
I have to translate in italian a simple application called TLX (task load index) edited by NASA in the 70's (I think).
Does anybody knows if is it possible to find source codes of existent tlx applications? and if it's possible, where can I find them?
I only have the exe file in english. I think I'll have to use MFC.
if anybody knows something about tlx please reply to this post!! I need heeeeeeeeeeelp.
ok. stop. thanks. kisses.
sorry for my bad english
jude
|
|
|
|
|
Hi,
did someone use the DrivePackageInstall? I used the follow code to test but this give to me two error messages( "can't open or write in the file"or "the syntax of file name, folder or volume is wrong" )
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char *pathInfFile = "C:\\driver\\mdmazlw.inf";
BOOL needReboot = FALSE;
DWORD driverInstalled;
driverInstalled = DriverPackageInstall(pathInfFile,
DRIVER_PACKAGE_SILENT,
NULL, &needReboot );
if(driverInstalled == ERROR_ACCESS_DENIED)
MessageBox(NULL,"problem","Test",MB_OK);
if(needReboot)
MessageBox(NULL,"Reinicie o computador para completar a instalação","Teste",MB_OK);
else
MessageBox(NULL,"Instalação efetuada com sucesso","Teste",MB_OK);
return 0;
}
I need help!!!
Gratefull,
Hélio
|
|
|
|
|
I am a bit new at C++. I am trying to important various functions from a .dll file. I have both the .dll and the .lib files, and I know the function definition because they were previously imported in a Visual Basic project. How can I use the functions? For example, say I have the files x.dll and x.lib, which contain a function int z(int). What do I need to do use that function? The only method I found was using the __declspec(dllimport) int z(int);, and I am not even sure if that is correct since it gave me linking errors.
Thanks in advance for your help.
Kiernan
|
|
|
|
|
kialmur wrote: ...I am not even sure if that is correct since it gave me linking errors.
Did you link with x.lib?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I am not quite sure how. I tried adding it to the project and also added it in one of project settings under Linking. Is there some otherway?
|
|
|
|
|
kialmur wrote: Is there some otherway?
There is, but if you are already adding it to the linker options, it's pointless.
Exactly what linker error(s) are you getting?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
The error is:
error LNK2001: unresolved external symbol "long __cdecl sendChipOffset(long,long,long)" (?sendChipOffset@@YAJJJJ@Z)
For the linking portion, I went in the project settings, then to the Link tab. I added the path under Object/library modules. Is that correct?
|
|
|
|
|
kialmur wrote: The error is:
error LNK2001: unresolved external symbol "long __cdecl sendChipOffset(long,long,long)" (?sendChipOffset@@YAJJJJ@Z)
This is a name-mangling issue.
kialmur wrote: Is that correct?
Yes.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I have a window that needs to display text using a fixed size (mono spaced) TT font (say Courier New) and the text will be limited to 80 columns by 24 rows. I need to calculate the bounding rect that keeps the aspect ratio of the font and centers it in the window.
I can get all this to work fine.
The next problem is choosing the font size. How do I get windows to give me a font size that will correctly fill this rect? Is this not possible? It seems no matter what I do, I get font sizes that do not scale up or down smoothly, and the text is usually either too small or too big.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
The MidiPlyr PSDK sample has code which scales the timer text so it fills the window (not very well mind you). It's located in Samples/Multimedia/Audio/MidiPlyr/uiutils.c:EmbossedTextOut() and CreateScaledFont(). 80% chance that the scaled font feature (and all of uiutils.c) was created as an extra credit assignment.
But anyway, the API to use is GetTextExtentPoint32.
-- modified at 11:43 Thursday 9th March, 2006
|
|
|
|
|
Thanks. I know about GetTextExtentPoint32. Unfortunately the problem is getting windows to use a reasonable font size. It appears that windows only has a few font sizes, and there's no provision or way to smoothly scale up or down without jumps in sizes. This means that sometimes the font matches the rect just fine, others it's too small, and other times it's too big. I'll look into the example though!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
The MidiPlyr sample also has this problem. It doesn't fully scale to the window, hence the jumps in font size you see.
So if Microsoft, for all their wealth, power and unrestricted access to the Windows source code, can't get it right, what hope do we poor insignificant developers who get the scrap heap public API, have ?
|
|
|
|
|
a little bit confused by ur post:
every row must contain 80 characters or differnt (max is 80)? all rows use same font? "display" means by paint (CDC etc) or text control (CEdit etc)?
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Hi everyone.
Can someone point me in the right direction to find an answer to a problem I have been posed by my boss!
We have approx 150 PCs (Win95 & 98), each running software which puts audio (16kHz sample rate, 8 bit ulaw)out of the parallel port into our own DAC board.
We wish to install NetMeeting in all these machines so that a VoIP call can be made to them from a central PC. The problem is that there are no soundcards fitted!
Any incoming audio (from Netmeeting) will need to be routed to the parallel port. Is it possible for NetMeeting to work without a soundcard?
Where would I need to start - is it a case that a specific codec would be need to be written to do this? If so is it a simple task? I am asuming that the source audio will be encoded at the same sample & bit rates as our DAC uses.
It would be perfectly adequate for the incoming audio to be simply put into a file, which I could then read and then write out of the parallel port.
My skills as a programmer are relatively low, is it something that a 'novice' can achieve?
I will have approx 10 weeks of full time work to achieve this - could it be done in this time?
I hope someone out there can point me in the right direction - or to the right forum!
Thanks for any help
Mike
|
|
|
|
|
69 Bay wrote: My skills as a programmer are relatively low, is it something that a 'novice' can achieve?I will have approx 10 weeks of full time work to achieve this - could it be done in this time?
You'll have to write a device driver to make the parallel port look like a sound card. Yes, it's possible, but depending on your skill level will probably take longer than 10 weeks, particularly since device drivers are notoriously difficult to debug.
Unless there's a strong reason not to, it would probably be cheaper for the company to put a cheap sound card ($10-20) in each computer, than to pay your wages for 10 weeks (or possibly longer) when you could be doing other stuff more suited to your abilities (yes, I'm assuming a lot here... I don't mean to offend).
If you do go the route of developing a driver, Toby Opferman has got a great series of articles on device driver development here[^]. Other resources may exist on the net. Ask google for a hand
Good luck!
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks Ryan
I will start looking at how to write device drivers!
The thinking behind doing this was that our customer wants the update, but will probably (if a sound card is required), pay one of his own engineers to go round and install the sound cards. If we could do the update without a sound card, we could then charge a bit more for the job, but he would pay less overall as he wouldnt need to update all the PCs
Thanks for your advice, now to look at how to do device drivers!
Mike
|
|
|
|