|
Please check this article, it will be useful
<a href="http://www.codeproject.com/KB/system/installed_programs.aspx">How to get a list of installed applications</a>[<a href="http://www.codeproject.com/KB/system/installed_programs.aspx" target="_blank" title="New Window">^</a>]
This article to doing the same, only you can filter those which you dont want.
Величие не Бога может быть недооценена.
|
|
|
|
|
Thanks for your reply.
But it still list all the programs installed on the system, updates, addons included.
|
|
|
|
|
kcynic wrote: I want to list all the installed programs like control panel Add/Remove programs. I know all the items would be list in the registry path:
'HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall'.
What you want is just not possible. Windows does not know about all programs that you have installed (especially the older ones), only the ones that have gone the "standard" route and updated the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall key.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
maybe it's a complicated work.
Thanks for your reply.
|
|
|
|
|
The Official method (used by "Add/Remove program") is with COM interfaces)
See on Win32 ng[^]
where the code has often ben posted (C++)
|
|
|
|
|
Thanks, I'll have a try
Regards
|
|
|
|
|
Don't bother. A quick look through kilt's post history shows that his suggestions are all but completely useless.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
My Windows MFC Application will receive a structure from a Unix machine (Big Endian) over UDP.
The structure has the following data types:-
struct RXData {
double timeStamp;
double item1;
long item2;
double item3;
int flag1;
bool state;
};
What do I need to do on the Windows platform to get the data in the correct format; i.e. do I use procedures like theses below - I did try but still not getting the correct answer.
float swap(float d)
{
float a;
unsigned char *dst = (unsigned char *)&a;
insigned char *src = (unsigned char *)&d;
dst[0] = src[3];
dst[1] = src[2];
dst[2] = src[1];
dst[3] = src[0];
return a;
}
short convert_short(short in)
{
short out;
char *p_in = (char *) ∈
char *p_out = (char *) &out;
p_out[0] = p_in[1];
p_out[1] = p_in[0];
return out;
}
The floats give incorrect values.
Any suggestions for this simple scheme please.
Regards,
Andy.
|
|
|
|
|
Actually you need to convert double s, not float s (i.e. 8-byte values instead of 4-byte ones).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
you said the struct holds doubles, yet you show a swap function dealing with floats, not doubles?
apart from that, everything looks OK. Although there are other schemes, some involving a union.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: Although there are other schemes, some involving a union.
Which I would normally opt for.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I cannot find a 'useful usage' of a union to reverse byte order (while I highly appreciate unions as 'variants').
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I am writing in C and using using VC++ 2008, .net 3.5 sp1 framework using a USB - to serial converter for serial port -- it comes up as COM4 on Windows 7 x64 as the operating system.
Need to read and write to a circuit board which gives out continuous output on the serial port.
I also do not know the header files to include in my main program to get the code to work.
Thanks,
|
|
|
|
|
A good place to look at [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Member 716143 wrote: Need to read and write to a circuit board which gives out continuous output on the serial port.
Output is a very generic terminology to use when asking for serial port advice.
What are your requirements?
Are you sending data over serial or do you require granular control over individual data pins?
For transferring data over serial this MSDN article contains nearly everything you need to know:
Serial Communications in Win32[^]
If you need granular control over data pins this BeyondLogic article gives in-depth details:
Interfacing the Serial / RS232 Port[^]
Best Wishes,
-David Delaune
|
|
|
|
|
I hope client can send some secure data at connect time vs CSocket::Connect, so that server can read the data and knows it is my client connection, or server rejects the connection immediately.
Is it possible to send user data vs CSocket::Connect?
|
|
|
|
|
includeh10 wrote: Is it possible to send user data vs CSocket::Connect?
Don't think so - I think authentication (for that's what you want) has to be done separately post-connect.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
includeh10 wrote: I hope client can send some secure data at connect time vs CSocket::Connect
In order to send and receive data during a connect operation you will need to use WSAConnect() rather than CSocket::Connect(). Keep in mind this is protocol dependent and is not supported by the TCP/IP stack.
1300 calories of pure beef goodness can't be wrong!
|
|
|
|
|
Note Connect data is supported only on ATM (RAWWAN) over a raw socket. TCP/IP in Windows does not support connect data.
it's my pleasure to make friend with you.
|
|
|
|
|
zhu_lin wrote: Connect data is supported only on ATM (RAWWAN) over a raw socket
Which would make it protocol dependent.
zhu_lin wrote: TCP/IP in Windows does not support connect data.
echo...echo...echo...
1300 calories of pure beef goodness can't be wrong!
|
|
|
|
|
from the msdn about WSAConnect:
The lpCallerData parameter contains a pointer to any user data that is to be sent along with the connection request (called connect data). This is additional data, not in the normal network data stream, that is sent with network requests to establish a connection. This option is used by legacy protocols such as DECNet, OSI TP4, and others.
Note Connect data is not supported by the TCP/IP protocol in Windows. Connect data is supported only on ATM (RAWWAN) over a raw socket.
it's my pleasure to make friend with you.
|
|
|
|
|
Hello,
You cannot do such a thing. Any validation should be done after accepting the connection only.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
No, a TCP stream must connect before exchanging data.
|
|
|
|
|
My client/server program is almost completed, the server may accept thousands of clients in real use.
As test, I generated 20 clients with heavy conversations to server, all are fine.
But ..., I never use any thread for listing, receving and sending.
From CSocket idea, I do think thread is not neccessary, however, I have a little suspection about this.
If you have created real commercial client/server programs before, which used CSocket, I need your comments:
Do you think thread is a must (or good, better) for client/server (TCP/IP) CSocket program? if yes, why?
Thanks
modified on Wednesday, August 12, 2009 1:25 PM
|
|
|
|
|
IIRC, MFC CSocket spawns its own thread for handling the data and it is this thread that sends the window messages that trigger CSocket methods such as OnReceive. So in a sense, you are already using a thread.
In general, if it works the way you want it to... why change it? Then again, you only used 20 clients to stress test a system that may have thousands. You may still need a better stress test. Although that would be true whether you leave it alone or change to a more direct threaded approach.
Just my $0.02.
|
|
|
|