|
Hi
I am creating a named pipe server with CreateNamedPipe(). Once a client connects, I use ImpersonateNamedPipeClient() and OpenThreadToken() to get the client's logon token. I then use LookupAccountSid() to get the client user account details. All standard stuff. *BUT* what I would like to do at this point is determine whether the client connected from a session logged on locally at the server, OR from another system. I *think* I need to check the logon type (LOGON32_LOGON_INTERACTIVE) but I have no idea how. Has anyone any idea how to do this?
Many thanks,
Neil Humphreys
|
|
|
|
|
I have a property sheet with lots of property pages.
Just before I launch the property sheet, I can type:
m_pViewPropertySheet->SetActivePage(1);
and that makes the first page active. I have alot of
helpful information on the 0th page; I have a button
on each property sheet that Im hoping that the end-user
can click on to switch them to the 0th property page.
I just can't get figure out the code to switch the user
from one property page to the another.
I could make a box popup that tells the user to go
click on the little tab at the top to switch to the
0th page for helpful information, but that's kinda
primitive.
I tried just letting the user figure out on their own
that the 0th page has lots of information, but they
never do.
Please, any response any one can give me will be
greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
|
Can you show me how to use either command? I looked on
codeproject and google and dont see any examples.
Please, please, please. Im in lets say property page 2
and when they click on a button, I want to switch to
property page 1.
Please, please, please any response you can give me will
be greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
Assuming MFC code (you didn't say what you were using), from the page 2 class, you can do something like:
CWnd* pSheet = GetParent();
pSheet->SendMessage ( PSM_SETCURSELID, 0, IDD_PAGE1 ); where IDD_PAGE1 is the resource ID of the page 1 dialog resource.
--Mike--
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb
Magnae clunes mihi placent, nec possum de hac re mentiri.
|
|
|
|
|
is there any way to use CFileDialog to select an HTML file out of a resource DLL? I need to beable to select files out of a resource DLL and files in the filesystem.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
(Steven Hicks)n+1 wrote:
is there any way to use CFileDialog to select an HTML file out of a resource DLL? I need to beable to select files out of a resource DLL and files in the filesystem.
I can't see how this is possible as the standard File Open only looks on Disk. You could add a new Category and display these Resource entries yourself, but this is quite a lot of work. I do this in ED (see sig) to display File History, Include files etc. in the File Open dialog.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
(Steven Hicks)n+1 wrote:
is there any way to use CFileDialog to select an HTML file out of a resource DLL?
Yes, but only if you write a shell namespace extension. It's probably more trouble than it's worth, and would be easier to write your own dialog box that looks and behaves similarly.
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"
|
|
|
|
|
Hello! Im fairly new to winsock programing, and am having trouble receiving a response that is spread accross several packets. I have been watching the communications through a packet sniffer, and know that 30 to 40 1500 byte sized packets are comming in with good data, but my program is only executing one recv and reporting a bytes Recv of 9. There must be some concept that im completely missing any help would be greatly appreciated.
heres my code:
bytesRecv = SOCKET_ERROR;
char queryRecvBuff[1500] = "";
CString reply = "";
send(m_socket,serverQuery,30,0);
TRACE("SENT\nRECEIVING:\n");
while( bytesRecv == SOCKET_ERROR ) {
bytesRecv = recv( m_socket, queryRecvBuff, 1500, 0);
if ( bytesRecv == 0 || bytesRecv == WSAECONNRESET ) {
TRACE( "Connection Closed in Auth.\n");
break;
}
if (bytesRecv < 0){
TRACE("\tbytes Recv < 0!!!");
return;
}
reply.Append(queryRecvBuff,bytesRecv);
TRACE( "\tBytes Recv: %ld\n", bytesRecv );
}
TRACE("\nRECEIVED");
output:
WAITING FOR Verification: VERIFIED
Sending Query: SENT
RECEIVING:
Bytes Recv: 9
RECEIVED
|
|
|
|
|
Knave777Wave wrote:
while( bytesRecv == SOCKET_ERROR ) {
bytesRecv = recv( m_socket, queryRecvBuff, 1500, 0);
I don't have all your code (ie. a server to send responses back) so I can't step through your code to really help you. But based on the code above:
SOCKET_ERROR is defined as having value -1
recv(...) is returning 9 bytes to you
This explains why the loop is only run once as bytesRecv will contain the value 9 which is not equal to -1 (SOCKET_ERROR).
As to if this is the proper value that is being recieved I don't know. If the first packet being sent from the server is of size 9 then this makes sense. Otherwise, I don't really know the reason.
Greba,
My lack of content on my home page should be entertaining.
|
|
|
|
|
thnx... i dont know what i was thinking
I switched it to a do--while w/ (bytesRecv != SOCKET_ERROR) and now i receive tons of packets and jump out of the loop with bytesRecv == 0.
Is this the normal behavior for such a transaction to end? Ive noticed several empty data packets being sent in the sniffer. Are these special packets that singal 'received' and so forth? If so, is my app receiving a special 'transfer done' packet that causes my last recv to unblock and return 0 bytes?
I dont know what the server is doing since it is not my app, its a particular games master server with a list of public game servers. I know all of this sounds pretty dumb, but this is a learning experiment where im trying to dive in a learn what is going on at the packet and app level.
thnx
|
|
|
|
|
Under the documentation of the recv function: "If the connection has been gracefully closed, the return value is zero". I'm assuming this would mean that the server has closed the connection. As to if this a correct or not assumption I don't know.
It doesn't sound pretty dumb, that is definitely a challanging and rewarding way to learn. If you still have problems with your recv, then I would suggest creating a server which emulates the behavior of the real server, and determine if you can send empty packets, and what happens when you close down a connection.
Greba,
My lack of content on my home page should be entertaining.
|
|
|
|
|
Anyone know how to do this?
ed
|
|
|
|
|
For example, suppose a project is composed of these 2 files:
//file1
extern int socket1;
//file2
int socket1;
Is possible to test for the existence of int socket1 during compilation if file2 is not part of the build, using some kind of compiler directives so that the project will compile/build normally?
|
|
|
|
|
A way to test for the existence of int socket1 in file1 would be use the preprocessor directives:
<br />
#ifdef socket1<br />
extern int socket1;<br />
#endif<br />
This will tell the preproccesor (what happens before compilation) to only use the code contained between "#ifdef socket1" and "#endif". If socket1 isn't defined (in file2) then the code between the preproccesor directives will not be compiled at all.
You will have to be careful though. Assuming you have code that used socket1 in file1 then you will get compile errors saying that socket1 isn't defined. To combat this you can do the following:
<br />
#ifdef socket1<br />
extern int socket1;<br />
#else<br />
int socket1;<br />
#endif<br />
I believe that answers your question.
Greba,
My lack of content on my home page should be entertaining.
|
|
|
|
|
jerry1211a wrote:
Is possible to test for the existence of int socket1 during co
Not directly, because the information you're looking for is not available at compile time, only link time. The extern int socket1 line tells the compiler "there's an int defined somewhere called socket1 " and that's all it needs. It's not until the linker comes along that the build process actually checks to see that socket1 is defined somewhere. That's why "unresolved external" errors are linker errors.
--Mike--
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb
Magnae clunes mihi placent, nec possum de hac re mentiri.
|
|
|
|
|
I'm trying to catch F6 being pressed using 'OnKeyDown', but when F6 is pressed I get nothing. Keys F1, F2, F3, F4, F5 & F7 all work (I haven't tried the other function keys yet).
It's got me scratching my head, I even changed the keyboard, but it still does nothing. Any ideas?
Thanks,
Ali
|
|
|
|
|
I recall having this problem in ED on a specific version of Windows where Windows itself grabbed F6. It may have been W2K. Just tried WXP and it is OK. Try a Google search. HTH.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Thanks for the advice, I have Googled it and no one else seems to have this problem. I am using WXP too!
I am compiling under VC++6, is that what you are using?
I'm going to try it on some other machines here, I have only tried 1 other so far, I'm wondering if it is another peice of software interfering with the keyboard int that I have installed on both machines I've tried.
(Now 'add a smiley' in CP isn't working for me either ... oh no, its going to be one of those days!)
Thanks again,
Ali
|
|
|
|
|
If I use Greta(or some STL implement) in MFC, who can give
me a code sample with backref and substitution. At least let
AfxMessageBox to show backref.
Is there some regular expression not STL implemented and free,
and full features with Perl, Henry Spencer's Regexp Engine is good but
does not support regexp like this :
.*? .+?
Thanks!
|
|
|
|
|
http://www.boost.org/
boost regex
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I have a semi-transparent window. I need all mouse clicks to fall through to proper windows underneath mine. I need to implement a "click-through window"
A previous suggestion was to return HTTRANSPARENT from WM_NCHITTEST. HTTRANSPARENT is usefull when you create a control and you want clickthrough to the parent (same thread). However in my case I want clicks to fall through a top level window to the underlying windows.
Does anyone have any further suggestions?
|
|
|
|
|
I am trying to create a flash movie from within an MFC (MDI) application. The movie must receive information from the program, but not necessarily send anything.
I am aware that I might need to launch IE to run the flash file, so help with that is also appreciated.
Here's what I am looking for:
1. What libraries do I need, and where to get them?
2. Perhaps a code snippet or documentation reference.
3. Code to launch IE (unless there's a way to display a flash movie in a regular MFC view).
Thanks
When the going gets tough... write a computer program to do it for you
When the going gets tough... write a computer program to do the thing for you
|
|
|
|
|
There is no need to launch Internet Explorer to display a Flash movie. Macromedia provides an ActiveX control. You don't even need any special libraries - all computer with flash player installed should have the ActiveX control available. Simple add the player to your toolbox and then add it to your dialog.
As far as I remember communicating with Flash is done via fscommand(??). Just search Macromedia for more information. I'm sure tutorial and documentation is available.
|
|
|
|
|
Hi everybody,
I'm trying to write my own installer tool at the moment.
I want to install the following components in this order:
[1] MSDE 2000
[2] MDAC 2.8
[3] .Net Framework
[4] my Application
In my code (console app) I do something like this:
1. start msdeSetup.exe (with CreateProcess(...))
2. Wait till msde is installed completely
3 start mdacSetup.exe .......
4. wait ...
5. start ...
and so on
this works quite well.
My Problem is now that I want to wait with the reboot till EVERYTHING is installed, but some of this components (e.g. msde) force a reboot by themselves.
So my Question is: How can I execute a File with CreateProcess(...) but suppress any reboot this app might perform, so I can start my own reboot when everything is installed
Thanks for your help
cu
immes
|
|
|
|