|
Sorry, but one last question. For the second parameter (Send To) it wants a constant unsigned short pointer. I have no idea what to do for this. I feel like I should put in a string with the computer name of which I'm sending to. Any ideas?
Thanks again,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
It's a wide character string specifying either the name of the computer to send to, or the IP address of the computer to send to. So, you could do something like this to send it to IP address 127.0.0.1 (your own computer):
NetMessageBufferSend( NULL,
L"127.0.0.1",
L"Bogus FromName",
(BYTE*)L"123",
6 );
The L character in front of the strings specifies that you want the string to be a wide character string. Note that the example isn't a real world example, it's just meant to show the simplest way to do it.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Ok, first let me appologize for being stupid. I can't figure out how to get an edit box to input wide characters. Do I need to start out as a string, then convert it to wide characters?
Thanks, again I appologize for being stupid,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
I edited this because it wasn't entirely accurate...
You don't have to apologize. Here's a sample of how to convert from a "TCHAR" string that the CString uses (which can be char or wchar_t), like you can get from the edit control, to a "whar_t" string, like the NetMessageBufferSend function expects:
CString a_sThisCameFromTheEditControl = "127.0.0.1";
wchar_t a_uszWillBePassedToTheFunction[128] = {0};
MultiByteToWideChar( CP_ACP, 0, a_sThisCameFromTheEditControl, -1, a_uszWillBePassedToTheFunction, sizeof( a_uszWillBePassedToTheFunction ) );
I'm not sure what will happen if you do a UNICODE build of your application though...
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Very cool! It all compiles! I can't wait to try it out (I'm not on a network here at home).
Thanks very much,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
How do I open a named object (memory mapping) created in a service from a user session app?
prefixing with
"Global\" ?
|
|
|
|
|
See OpenFileMapping()[^]
If you're not using Terminal Services, as the above link states, then "Global\" would be ignored.
|
|
|
|
|
ian mariano wrote:
If you're not using Terminal Services, as the above link states, then "Global\" would be ignored.
...unless you are running on NT4. There the global prefix would cause an error!
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
My menu works fine until I make a new child... then the menu changes to the 2nd one and I lose all changes to the menu.
How can I detect the change of menus to the one used with MDI children active, so I can update the 2nd menu?
Or is there a better way of dealing with this? Modify both menus at once when needed? If so then how? I didn't find any referenches to the 2nd one.
|
|
|
|
|
I m developing an SDI application derived from class CView in MFC. I have to change the color of whole window which includes Menus,Frame Window & Client Area. I am succeed in changing the color of client area of SDI & Toolbar, but I don't know that how can I change the colors of Frame Window & Menus.
Is there any way to change the colors of Frame Window & Menus.
awaiting for reply.
regards,
M. Usman Ghani Khan
|
|
|
|
|
One solution is to derive a class from CFrameWnd and paint the frame. The same concept works for menu.
Kuphryn
|
|
|
|
|
hello.
i have overriden WindowProc for CButton-derived control and handle WM_MOUSEMOVE message
in message handler i call ::SetCursorPos
all i want to know is: does ::SetCursorPos function send WM_MOUSEMOVE message or not?
thanks in advance
nobody is perfect
|
|
|
|
|
AFIAK it sends the WM_MOUSEMOVE message to the window that contains the cursor's new position, but not to the window that contains the cursors old position.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
what about SetCapture?
nobody is perfect
|
|
|
|
|
What about it?
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
i meant that if i SetCapture in CButton-derived control and in its WM_MOUSEMOVE message handler call ::SetCursorPos, will this control receive MW_MOUSEMOVE again?
nobody is perfect
|
|
|
|
|
Yes, I believe so. Any window that has captured the mouse will receive all mouse messages.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Hi,
I'd like to use SQL in my program... I don't care which implementation, but mySQL sequel would be fine. I just need it to work without the servert installed (on the user cup, that means it should work it out itself I guess). I tried one, but I quite didn't like it cause it didn't recognize types (which was explained to be advantage, which I may agree with, but I'm not happy about that). Anybody and suggestions
Thanks
|
|
|
|
|
I wrote two asp pages: TestPage1.asp and ActionPage1.asp
TestPage1 is a simple page with a textbox and a submit button. It CreateObject and loads ActionPage1.asp.
In ActionPage1.asp, I destroy/dereference the server object:
Set Session("objSQLGen") = Nothing
The object gets destroyed as planned. However, if you click "Back" and submit again, you get an error trying to access an object that has been destroyed. So, the first block of ActionPage1.asp is to re-create the server object, if it hasnt already been created:
<% If Session("objSQLGen") = Nothing then
Set Session("objSQLGen") = Server.CreateObject("QueryGenAlpha.QueryGenerator")
End If
%>
However, I still have error saying that the object doesnt support the method or something.
I hope someone can see what's the error in this code...
(1) This is the opening page:
<%
Set Session("objSQLGen") = Server.CreateObject("QueryGenAlpha.QueryGenerator")
%>
<title>
Query Generator
RealTime7 Inc Query Generator
Enter txtParam:
(2) This is the action page:
THIS FIRST BLOCK HERE IS TO RE_CREATE THE SERVER OBJECT IF IT HASNT ALREADY BEEN CREATED.
<% If Session("objSQLGen") = Nothing then
Set Session("objSQLGen") = Server.CreateObject("QueryGenAlpha.QueryGenerator")
End If
%>
<title>
Generate SQL query statement.
<%
txtParam = Request.Form("txtParam")
txtSQL = Session("objSQLGen").GenQuery(txtParam)
Response.Write(txtSQL)
%>
<% Set Session("objSQLGen") = Nothing %>
(3) And the error that I'm getting is:
Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method
/ActionPage1.asp, line 1
This is really weird. Very weird indeed.
Thanks.
norm
|
|
|
|
|
norm wrote:
If Session("objSQLGen") = Nothing then
Set Session("objSQLGen") = Server.CreateObject("QueryGenAlpha.QueryGenerator")
End If
Why do you need to set it to nothing ?
Get rid of the 'if', as a starter. Also, why does it need to be in the session ? I'd just create the thing locally unless there is a real need for it to persist across pages, and my understanding is there isn't, you're just creating in one and destroying in the other.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-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
|
|
|
|
|
I've written a program which has a tree control placed on a dialogbar in a MDI application.I want my tree control to have this ability that if I click on a tree item , it shows the coresponding item that I've drawn before on the document.I wrote some codes for it but when I use the "SetModifiedFlag" and "UpdateAllViews" functions, it issues error that "program should be terminated and the instruction at the specified address couldn't be read.".Is this possible to do ?
|
|
|
|
|
Well most anything is possible, and I can't see why this should be an exception. I suggest you run your app as a Debug Build and you should be able to see valuable information about the crash when it occures. One would assume you are corrupting memory somewhere or something like that.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I run it in debug mode.I have written a function in my class CMyDoc::CDocument and I call it without any problem
but when I call SetModifiedFlagfunction , an exception raises. I think this problem relates to the way I call these functions.I defined a global pointer to CMyDoc and initialized it with the GetDocument function in the
CMyView::CView .So I use this global pointer to call CMyDoc functions.Of course I call these functions in another
class CMyTreeCtrl::CTreeCtrl.
|
|
|
|
|
Well the first thing I'd do is get rid of the global and all other globals. You are just asking for trouble using globals. Presumeably you know the view or can find it and then use it's GetDocument() function.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Even I used CFrameWnd::GetActiveDocument() to get pointer to the document , but it wasn't useful and the same error is repeated.
|
|
|
|