|
Another thought that struck me: Are you sending any messages from one control to another?
I've seen cases where, during handling of a window message, one control sends a message to another control when it instead should have posted it. This can lead to the second control creating another update message being sent from windows and...
Let's just say that the call stack can grow really deep.
|
|
|
|
|
Any body used boost library in VC++ ?? I am using it first time for exploring thread models but the VC++ compiler is giving Linker errors. It seems to me that Linker settings are not appropriate. If any one of you know the linker settings for boost library in VC++ 6.0 then please tell me. I've posted this problem in boost forums but no answer is arriving.
SattarA
|
|
|
|
|
I've used it a little bit. But I've only used the regex and lexical_cast stuff out of it, not the thread library. I have had no trouble using it in Visual C++ 6.0.
What sort of linker errors?
|
|
|
|
|
Is there any way to read Motorolla-style (Big Endian) file formats? The problem is that bytes ordering starts from high byte to low byte, unlike usual (for Windows) from low to high. E.g. if you will write DWORD type with value 1 into binary file using any file routines (MFC, API, whatever) you will see in the file such numbers: (in hex display)
01 00 00 00
When you'll read it, you will get you "1" back.
Now Motorolla style is vise versa:
00 00 00 01
I have such file (actually everyone has it - it is TrueType fonts) and I need to read the numbers in it correctly. Of course when I'm using CFile or file handle to read data, I get different numbers, since it reads it in Windows style
Any way to override it?
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
We have done a lot of work rearranging bytes and words between big-endian and little-endian systems. Be careful, though, as usually the difference is not byte reversal, but word (i.e., 2-byte groups) reversal, depending on the processor. A fairly easy approach is to use a structure with high-word and low-word (or bytes, as needed). The read function can read file contents into the big-endian elements of the structure, and then a little-endian value can be constructed by combining those elements in reverse order.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
Uff.. lol
Well, did it, but it is kinda dissapointing to reverse bytes and words for each member of structure
Imaging that I have like 5 structures (for now) and about 5 members in each (short or long). I'm rearranging the order for each member. What I thought, maybe there is some "flag" in functions like "CreateFile", etc., which will tell the system to read data in Big endian style. But didn't find nothing, so I guess this is the only way
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
I agree, if only it were that easy. We run into this problem when reading data from external hardware devices. Many of those are made with an embedded chip and their available output has that chip's byte ordering. May or may not correspond to PCs and Windows, so we have to change it as needed. Unfortunately, I haven't ever seen that nice flag, but it sure would be useful.
Good luck,
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
I've defined the interfaces IRolesUsers and IRole (from IDispatch). They should be implemented by the following coclass:
coclass RolesUsers
{
[default] interface IRolesUsers;
interface IRole;
};
The problem is that in VB the interface IRolesUsers appears "RolesUsers" but
IRole comes with "IRole".
What should i do to make IRole be exposed "Role" or IRolesUsers to be "IRolesUsers"?
rechi
|
|
|
|
|
... connections from the clients in the LAN?
I can make my app listen to the LAN IP... is it the only way?
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Add an entry to your firewall to deny connections from other IPs to that particular port. If you don't have a firewall, I guess on each connection, you can reject or accept it depending on whether it's an allowed address or not. Or perhaps when you bind, bind to the internal IP address, though I am not sure that works. Just try it out anyway and let me know please
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish [BusterBoy] wrote:
I guess on each connection, you can reject or accept it depending on whether it's an allowed address or not
You mean I add some IPs to the program and then when a connection is coming up I check if the IP is one of those which is added to the program?
Nish [BusterBoy] wrote:
Or perhaps when you bind, bind to the internal IP address
You mean, if the LAN IP of the computer is 192.168.244.138 then I assign the SOCKADDR_INs structure member sin_addr.s_addr to inet_addr("192.168.244.138")??
Do you understand me?
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Rickard Andersson wrote:
You mean, if the LAN IP of the computer is 192.168.244.138 then I assign the SOCKADDR_INs structure member sin_addr.s_addr to inet_addr("192.168.244.138")??
Yes, that's what I mean
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish [BusterBoy] wrote:
Yes, that's what I mean
then I can tell you: It works!
So if I do this, nobody could connect to the server... cool!! Thank you for all other topics!
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Rickard Andersson wrote:
then I can tell you: It works!
Cool!
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Looks good
Just in case your interested, here is a snippet of an old perl code.
It was an http deamon used as chat server, which can block unwanted IPs. Default setting below is allowing all incoming clients. I think you can imagine how to limit on only LAN IPs.
<br />
# AccessList: Define the access permitted list of IP's <br />
# (use komma as seperator).<br />
AccessList = *.*.*.*<br />
<br />
# DenyLis: Define the noaccess list, any IP matching a member of this<br />
# list will be denied access. The denylist is searched after the<br />
# accesslist (look above).<br />
DenyList = <br />
{
...
# Check to see if caller can access the server, if not kick him
if(!&CheckAccess($ENV{REMOTE_ADDR},@AccessList)) {
&ErrorMessage(*NS,$inp,403,"Access Denied"); exit 0
}
# Check to see if the caller is explicitly denied access to the server
if(&CheckAccess($ENV{REMOTE_ADDR},@DenyList)) {
&ErrorMessage(*NS,$inp,403,"Access Denied"); exit 0
}
...
}
# Test client IP against access lists, returns true if match
sub CheckAccess {
my ($who,@list) = @_;
my $pattern;
foreach $pattern (@list) {
$pattern =~ s/\./\\./g ; #replace . by \.
$pattern =~ s/\*/\\d\+/g; #replace * by \d+
return 1 if $who =~ /$pattern/;
}
return 0; #search failed
}
|
|
|
|
|
Nish and Rechard,
Thanks a lot! I want to know it is possible or not
to insert and eject cd-rom door by using Scsi command,
such as, sendaspi32command. If the the cd-rom is a local
one, it is not needed for considering the IP address. If it
is a intenet cdrom, i will try to the ones your provided.
Best Regards,
chen
|
|
|
|
|
Is it possible to retrieve all clients IP in my LAN in my program??
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
http://www.codeproject.com/treectrl/networktreectrl.asp
Article by Paolo Messina.
-Gile
|
|
|
|
|
Thanks!
I will post a message if I have problems!
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
I'm curious if it helped? I would try to make a UDP broadcast into the LAN and let my clients answer on it with a short "hello i'm here".
|
|
|
|
|
Well... I have checked the code now and don't see anything that can give me the IPs...
Moak.. do you know how to do that?!
Sample code maybe!?
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Hej Rickard,
have a look into the winsock FAQ, there should be an example with UDP programming. Basically you send out a short UDP package ("ping") to everyone in the LAN (broadcast), your clients listen to it and answer with another package telling that they are alive and understand your protocol ("pong"). So you will get and collect the "pongs" and get IPs of all alive clients in the LAN. Unfortunately, UDP broadcasts will be usually filtered out on routers (at least from your ISP for heaven's sake), so maybe you will only reach client in the current LAN interface. Just give it a try.
If you need a "deep LAN broadcast" try multicast (much more modern than UDP broadcast AFAIK) or setup a central directory server or a kind of superpeer where all clients register, then you get all clients IPs in the LAN. Actually I prefer the true P2P decentralized solution, but that is your decision.
Code, sorry Im not far now still working on my GUI (again), in a few week I will hopefully find time to do UDP too. Mee me on IRC
/Moak
|
|
|
|
|
Moak
Why not sign in on CodeProject!?
Thanks for your help! I will look up some more info about that now! (Danke! )
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Hi,
How to use the function SetDlgMsgResult ?
The follows are an example, but I can't understand their meaning,
#define adgHANDLE_DLGMSG(hwnd, message, fn)
case (message): return (SetDlgMsgResult(hwnd, uMsg,
HANDLE_##message((hwnd), (wParam), (lParam), (fn))))
Jeffrey Richter said:
The normal HANDLE_MSG macro in WINDOWSX.H does not work properly for dialog boxes because DlgProc's return a BOOL instead of an LRESULT (like
WndProcs). This adgHANDLE_DLGMSG macro corrects the problem.
My Question is, the parameter list in SetDlgMsgResult(HWND hwnd, int msg, LONG result) puzzles me. Which parameter replaces which parameter, and where does this action take place, in memory of window?
Thank you.
Best regard.
One concrete prolem is worth a thousand unapplied abstractions.
|
|
|
|
|
There is no API or MFC call named SetDlgMsgResult. SetDlgMsgResult seems to be one of Richter's custom functions too
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|