|
The only requirement is that you need an entry in the stringtable that matches the menu ID
...............
To modify the string table can change the message staticly.
Is there a way to change the strings dynamicly that match with the menu id before displaying on the StatusBar?
I love you not for whom you are, but who i am when I'm by your side
|
|
|
|
|
gohappy_1999 wrote:
Is there a way to change the strings dynamicly that match with the menu id before displaying on the StatusBar?
This defeats what MFC is giving you for free. Why circumvent that? It is coded to look in the stringtable for a resource having the same ID as the menu item.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I have encountered a problem when i try to access database built on a remote server...
but when i tried accessing database on my local computer, this problem did not occur...
Anybody know how to solve this problem?
|
|
|
|
|
It would make this question much easier to answer if you could at least post the error you get when you try to access the database. But if I have to guess, I would think that you are using the default service account. That account doesn't have rights to access the network, instead you should create a user with normal user rights, and use that user with your service.
Magnus
|
|
|
|
|
But i have used this account in many normal applications(not service) to access the database already, it works fine. Does that mean it should not be because the account does not have the rights to access the network?
I will try to add in a normal account, and feedback here~ thanks so much~
|
|
|
|
|
And the reason why i did not provide the error message here is because it is a runtime error, no information in detail given!
|
|
|
|
|
From your service running under the system accoun, you can impersonate a user who has permission to access the database:
HANDLE token = NULL;j
if (LogonUser(szUser, szHostName, szPassword, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, &token))
{
if (!ImpersonateLoggedOnUser(token))
{
CloseHandle(token);
token = NULL;
}
}
and then to revert to the system account:
if (token)
{
RevertToSelf();
CloseHandle(token);
}
|
|
|
|
|
Sorry,what does this mean? Does that means i need to impersonate an account to have the permission to access the database before connection?
|
|
|
|
|
I want to create a DLL in C++/VC++.
This dll will be called from C#.
How i will create it and how i will pass C++ structure as a parameter to my function.
|
|
|
|
|
--Your C++ code would look like the following
typedef struct St
{
int a;
int b;
}
__declspec(dllexport) void SetMyStruct( St* s );
--Now, in your c# code you would do the following:
[System.Runtime.InteropServices.LayoutKind(LayoutKindSequential)]
public struct St
{
public int a;
public int b;
}
public class MyClass
{
[DllImport("mydll.dll")]
public static extern void SetMyStruct( ref St s );
}
I hope this helps.
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
Hoping someone can direct me to a solution on this. I have developed a pretty basic Client/Server system using Winsock2 using TCP (aka SOCK_STREAM)and when the client application of our system is installed and run on XP Pro, the application fails to open the socket when calling WSASocket. This has happened on two different machines. This problem does not occur on XP Home nor on Win2K Pro. Both of the problem machines have been upgraded to SP2.
Here is the code:
Socket = WSASocket (AF_INET,
SOCK_STREAM,
IPPROTO_TCP,
NULL, // LPWSAPROTOCOL_INFO lpProtocolInfo
0, // GROUP (reserved)
0); // DWORD dwFlags
This call in XP Pro returns INVALID_SOCKET and a subsequent call to WSAGetLastError() returns 0 which means it was successful. Hogwash. Need help on this.
Thanks,
Mike
|
|
|
|
|
Hi,
RepliGo is a utility that allow you to convert Office file to RepliGo file for reading them in Palm.
RepliGo provide a virtual printer for us to do that work.
I'm using RepliGo's virtual printer to convert (.DOC, .XLS, .PPT) file to .RGO file.
I used DDE command to do that work. For example, with .DOC file, I have DDE command :
-------------------------------------------------------------------------
[REM _DDE_Minimize][FileOpen("%1")][t=IsDocumentDirty()][FilePrint 0][SetDocumentDirty t][DocClose]
-------------------------------------------------------------------------
(Can find it in Window Registry)
And I used classExec utitlity to run that DDE command.
My application is built as the server/client model. Server run as windows service.
My problem is:
+ When I login Window with specified user, from client, I can convert all files summarised before to .RGO.
+ But when I restart, not yet login window (at login form), from client, I can't convert them.
(May be I have not logged in Window yet, so I don't have DESKTOP for RepliGo's virtual printer to run)
Please tell me what to do with this problem.
Thanks a lot.
|
|
|
|
|
I would like to activate a button only when my boolean "bActive" is true(he is false at initialisation).
How can i do that?
Thanks in advance
|
|
|
|
|
In your dialog class:
GetDlgItem(IDC_YOURBUTTON)->EnableWindow(bActive);
Hope this helps
|
|
|
|
|
thanks you
|
|
|
|
|
Hi everybody,
I would need your help...I have to create a rectangle on clicking LEFT-Button of the mouse and tracking it over the screen. I mean, the typical one that appears when you select, for instance, several icons on the desktop. I want to do this to get the coordenaes of the rectangle made by the user. How can I do it?
In this site :
http://www.codeguru.com/Cpp/G-M/gdi/article.php/c139/
It explains how to do it, the problem is that if you execute the application you will see that when you move the mouse to create the rectangle, the program doesn't erase the previous rectangle before tracking the mouse. How can I do to delete the previous rectangles? Or could you give a link to search for it?
Thanks,
Javi
|
|
|
|
|
This is usually done calling DrawFocusRect . Before drawing a rectangle with it, you first call it with the previous rectangle coordinates, which erases the last drawing.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
|
Hi All,
Can anyone help me how to make a VSC++(6.0) ActiveX Dll that will be calling VB.Net ActiveX Dll? Example I want to pass 2 parameter Strings to a C++ class/function with a value of "2" and "1". Inside the c++ dll, it will call the vb.net activeX dll that will sum the 2 nos. and will return 3 of float data type to the c++ dll.
your answer will be very much appreciated.
Thanks
|
|
|
|
|
how do you guys make a dialog window overlap everything? even games?
i understand the command
CDialog::SetWindowPos&wndTopMost,0,100,0,0,SWP_NOACTIVATE|SWP_NOSIZE);
but it does not overlap games
i have seen advertisers like netzero advertisements managed to overlap everything even games in full screen mode
SetWindowPos is insufficient in this case
what's is the easiest way to do this overlapping feat?
please advise
|
|
|
|
|
Will a system-modal dialog work?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
nope it doesnt
it's the same as the windowsetpos command above
|
|
|
|
|
problem code:
pMetaFileDC->SelectObject(newPen);
when debug, it causes an assertion. the source is:
{ ASSERT(m_hDC == m_hAttribDC); // ASSERT a simple CDC object
return (hObject != NULL) ? ::SelectObject(m_hDC, hObject) : NULL; }
ok, then i write this:
pDoc->pMetaFileDC->SetAttribDC(pDoc->pMetaFileDC->GetSafeHdc());
but this fuciton do not work as supposed. and the assertion remains.
look into the source code:
void CMetaFileDC::SetAttribDC(HDC hDC) // Set the Attribute DC
{
if (hDC != m_hDC)
CDC::SetAttribDC(hDC);
if (m_hDC == m_hAttribDC) // if we somehow got to this, correct it
ReleaseAttribDC();
}
i am really confused! what am i supposed to do?
in addition, if i do nothing but use the release vision, i find it works quite well without any problem.
reference this:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/_core_the_trace_macro.asp[^]
|
|
|
|
|
wrb302 wrote:
in addition, if i do nothing but use the release vision, i find it works quite well without any problem.
Wrong. The problem still exists. The reason you do not see it is because the ASSERT() macro has been removed by the preprocessor in Release mode.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi,
In my application I draw a property page, and hit a button on this property page to open a new dialog(which will close the property page). Now I want to show the property page on a button click from this new dialog. For which I have code in OnButtonBlickInThisNewDialog as
propSheetPtr->DoModal();
But the prop sheet is not showing up, instead seems like its being displayed for a fraction of a second and goes off. I checked the value of this propSheetPtr it is not deleted, i.e. prop sheet pointer still has the same values as it had when displayed earlier
Also tried
propSheetPtr->ShowWindow(SW_SHOW)
but the property sheet does not stay (displayed!)
Can anybody help me out for this issue?
Thanks.
|
|
|
|