|
In my application (which is running fine except one warning) a main sdi window creates a modeless dialog when user selects an option from menu. If the modeless option is not created there is no warning but if modeless dialog is created then the above warning is shown at the end of program in output window. It means it has something to do with modeless dialog, but i cant figure it out.
please help.
|
|
|
|
|
That message is normally shown when you have a menu or toolbar command that does not have a message line associated with it. Normally when you create a command, you also specify a line of text to be shown on the Status Bar, and the framework automatically looks this up (as a String Table entry with the same ID as the command) and use it.
Try making sure that all menu/TB commands text in their "Prompt:" field (on VC6, not sure what it is called in VS.Net).
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I have a CString loaded with a RGB value (255,0,0 or 0,255,00, etc). I am trying to parse out the three parts into three int variables to use in a RGB() function. Is there an easy way to do this in MFC?
-- modified at 11:33 Thursday 28th September, 2006
|
|
|
|
|
|
The CString class has the Tokenize function that you can use to parse the comma-separated strings. You will need to convert the individual value strings to integers yourselft though (_ttoi()??).
I Dream of Absolute Zero
|
|
|
|
|
efriese1 wrote: Is there an easy way to do this in MFC?
Sure, just use AfxExtractSubString() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
Well, if you want to drop down to the RTL, you can use sscanf(...) and its variants to scan the values out.
int iRed = 0;
int iGreen = 0;
int iBlue = 0;
int iTokens = ::_stscanf( _T( "255,0,0" ), _T( "%d,%d,%d" ), &iRed, &iGreen, &iBlue ); That should scan the three values into the three variables.
Generally, if you can build a string using sprintf(...) you can scan it using scanf(...) .
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hello,
is it possible to create an Button or Button's for an MSAccess.mdb ?
I think it is to use ActiveX?
Is there any Tutorial's or democode ?
Thanks for Tip's an Help.
Greating from Bremen (Ger)
Fanker
|
|
|
|
|
I think you will have to explain furthur exactly what you mean by this. I mean what exactly is this button to do? Launch msaccess with some file? Actually view and modify a database?
John
|
|
|
|
|
Hi John,
thank for your answer. I mean it general: Some button to open Forms, ok-button to save input's in database and view, modify database.
I will have the same button in my forms, without to copy the button in each form of the Access.mdb. I hope also to create my own button - looks like better than Access-button.
The method(on-click, dblclick) for the button should be in the Access-VBA.
Thanks a lot for your time.
Fred
|
|
|
|
|
01fanker wrote: I hope also to create my own button - looks like better than Access-button.
Search Office ActiveX controls http://www.codeproject.com/com/officeatlprint.asp[^] is an example.
What is it about the standard buttons in Access you don’t like? As memory serves they are highly customizable. I believe the office controls can also be sub-classed in vb (which would be much easier than creating an add in which would need to be installed on the target machines).
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
i wonder if someone can help me with the creaion of a COM object. I am trying to
I am trying to create an object of CDOMessage but am failing at the 1st hurdle.
Firstly, information about the COM object can be found here.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html/c138a402-4842-4bb3-988e-43cb9917e94b.asp
At the bottom of the page the example has VB and C++ mixed in one but the c++ example looks like this:
<br />
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace raw_interfaces_only<br />
#import <cdosys.dll> no_namespace raw_interfaces_only<br />
#include <cdosysstr.h>
#include <iostream.h><br />
<br />
main(){<br />
CoInitialize(NULL);
IMessage* pMsg = NULL;<br />
<br />
HRESULT hr = CoCreateInstance(__uuidof(Message),<br />
NULL,<br />
CLSCTX_INPROC_SERVER,<br />
__uuidof(IMessage),<br />
reinterpret_cast<void**>(&pMsg));<br />
However when i try to compile the above code i get the error:
Error 1 error C2065: 'IMessage' : undeclared identifier c:\c++localprojects\cdomessage\cdomessage\cdomessagedlg.cpp 103
Now if i fire up OLE/COM Viewer that you get with Visual Studio and do a search in "All Objects" for CDOMessage i find
that it is all registered ok with my system.
notice in the example above __uuidof & __uuidof is being used. I have not come across these before so went about calling
CoCreateInstance the normal way passing interface id's and class id's
for example here is a call from a com intro article here on cp: http://www.codeproject.com/com/comintro.asp
<br />
HRESULT hr;<br />
IShellLink* pISL; <br />
<br />
hr = CoCreateInstance ( CLSID_ShellLink,
NULL,
CLSCTX_INPROC_SERVER,
IID_IShellLink,
(void**) &pISL );
Now for me to create a CDOMessage COM object i need know:
1) the CLSID of the coclass
2) the IID (interfaceid)
3) an interface pointer
however using OLE/COM Viewer the CLSID is {CD000001-8B95-11D1-82DB-00C04FB1625D} instead of a readable form like CLSID_ShellLink.
Is it ok for me to just pass through CD000001-8B95-11D1-82DB-00C04FB1625D?? Secondly, OLE/COM Viewer does not show me the IID for me
to pass through.. And finally what interface pointer should i use?
|
|
|
|
|
flippydeflippydebop wrote: Error 1 error C2065: 'IMessage' : undeclared identifier
this compiles without error for me. Are you sure there is not a previous error about not finding a file or something?
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace raw_interfaces_only
#import <cdosys.dll> no_namespace raw_interfaces_only
#include <cdosysstr.h>
class CDOTest
{
CDOTest()
{
IMessage* pMsg;
HRESULT hr = CoCreateInstance(__uuidof(Message),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IMessage),
reinterpret_cast<void**>(&pMsg)); }
};
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real" Score: 1.0 in the Soap Box
led mike
|
|
|
|
|
hello and thanks for your reply.
hmm!! well i have just tried this in a fresh project in visual studio 6 and it gave me an error when #including <cdosysstr.h>.. I commented out this line and all compiles well.
My original project i was was sont in Visual Studio 2005. So my rub here is that it doesnt compile using VS2005.
Using VS2005 it it does not complain when i #include <cdosysstr.h> but gives me the error msg:
Error 1 error C2065: 'IMessage' : undeclared identifier
what version of C++ did you use in your sample?
|
|
|
|
|
flippydeflippydebop wrote: So my rub here is that it doesnt compile using VS2005.
I used VS2005.
led mike
|
|
|
|
|
well the only thing i can think is that i have got issues with path includes maybe... back to the drawing board!
|
|
|
|
|
hiya again... just looking at this again today..
can i ask, in your working vestion is your HRESULT equal to OK. My visual studio 6 sample
is compiling ok but when it runs it doesnt successfully create an instance of the object
and the pMsg pointer is equal to NULL.
HRESULT hr = CoCreateInstance(__uuidof(Message),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IMessage),
reinterpret_cast<void**>(&pMsg));
assert(SUCCEEDED(hr));
Also i have noticed that in OleViewer when i try to expand CDOMessage oleview simply closes
down as if it has encountered an error
|
|
|
|
|
flippydeflippydebop wrote: in your working vestion is your HRESULT equal to OK
Yes.flippydeflippydebop wrote: oleview simply closes
down as if it has encountered an error
Sound like you might have an environment problem. Check the Event Logs for any messages related to the shutdown of OleViewer.
led mike
|
|
|
|
|
|
Is there anybody knowns where was IE's "Manage Add-ons" dialog implemented?
I can't find it in shdocvw.dll,shlwapi.dll,iexplorer.exe........
where is it?
|
|
|
|
|
Hi all,
In one of my applications, the user gets a modal dialog box, in which he enters some information. In order to support him in diong that, I also display a modeless dialog with some additional information. (CDialog::Create (IDD_TEMPLATE, NULL)). The order is: first initialize the modeless dialog, then call the DoModal for the modal dialog. However, the user is now not able to move or resize the modeless dialog or to put it on top of the modal dialog to diaplsy all the information, until the modal dialog closes.
It would of course be possible to also use a modeless dialog for the second dialog box, but then I need to loop for the user to push the OK (or Cancel) button, and I would possible need to do a whole lot of other things that Windows is now handeling for me.
How can I create the modeless dialog so that it will act as if it were another application (in the sense that I can move it, put it on top of others, etc)
Anyone any suggestions please?
Thanks in advance,
William
|
|
|
|
|
Create the modeless dialog within the modal dialog's OnInitDialog() method.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks, I'll try that.
Regards,
WIlliam
|
|
|
|
|
I add some Strings in a ListBox. Now I want change the Color of some Letters in the ListBox. It is possible? Can someone help me? Thanks
|
|
|
|