|
More information is needed (you've supplied almost none). For example, what framework (if any) did you use? Can you post some source code (in particular the IDispatch implementation)?
Steve
|
|
|
|
|
Hi Stephen,
Thanks for your reply.
I have create a new application with MFC Activex control wizard I have kept all default setting.
Then I have added the property Font with Implementation as Get/Set and then I kept two break point one in GetFont and another in SetFont.
When I try to debug that control using Activex control Test Container I can move to Getfont when I Invoke GetFont function but I am not able to move to Setfont function when I invoke Setfont instead it moves to GetFont function.
GG
|
|
|
|
|
The first thing I'd test is if the debugger is telling you the truth: putting MessageBox es with the names of the methods in the two functions is a quick and dirty way to verify this. I assume you're debugging with the debug build? Assuming this doesn't clear things up post your Dispatch Map[^] (post all uses of the macros in the link I gave).
Steve
|
|
|
|
|
It looks like you actually haven't a SetFont method in your interface. Could you please post the relevant code? You should also move your post to the COM [^] forum for better help.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi Pallini,
Thanks for your reply.
If we add a property with get/set for font we get this code. I have kept two beak point one in GetFont (return NULL) and another in SetFont(SetModifiedFlag();)
if I Debug using Activex control Test Container.When I invoke Getfont it goes to Getfont Function .But if Invoke Setfont it move to GetFont Could help me in this part to solve this issue.
LPFONTDISP CMySampleFontCtrl::GetFont()
{
// TODO: Add your property handler here
return NULL;
}
void CMySampleFontCtrl::SetFont(LPFONTDISP newValue)
{
// TODO: Add your property handler here
SetModifiedFlag();
}
GG
|
|
|
|
|
You should show us also how these methods are mapped to the COM interface (i.e. the relevant MIDL generated code, if I remeber well...).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi ,
Thanks for supporting me.
I got the answer for the question which I have asked.
we can override OnFontChanged through which we see the changes when we invoke SetFont
GG
|
|
|
|
|
hello all,
I want to get search update for remote machine.Means how many updates it wants and all.
how do i use WUA API for remote machine please help me .I Visited microsoft website but not get proper idea.
|
|
|
|
|
i build a new MFC project using a string to initial a new string mm
code is
string mm = "abc";
debug mode mm will be "abc";
but in release mm will be "`v;"
when in debug mode it will be ok
see below photo:
but when in release it will no right
see below;
why does that happen can help me
by the way how to upload photo in codeproject
thank you
modified on Tuesday, April 28, 2009 3:29 AM
|
|
|
|
|
Debugging Release version, built without debugging info, may lead to apparently strange results, I believe.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You may add yourself to the list of contributers of the "CP's memorable quotes" list.
modified on Tuesday, April 28, 2009 4:20 AM
|
|
|
|
|
Too kind man, too kind, indeed.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Maybe other codes bring memory error.
BTW, you can use CString here.
Welcome to www.softwaretree.net!
This website is generated completely by static html pages transforming technology.
You can find many excellent audio/video tools there!
|
|
|
|
|
Why CString is supposed to behave better than std::string there (everywhere)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi
How to set Greek characters in FlexGrid cells?I used SetText function ,but it is setting
other characters.
example
If I want to set "λ" in flexgrid cell it is setting "ё" instead
please help
modified on Tuesday, April 28, 2009 5:00 AM
|
|
|
|
|
Hi, i don't know FlexGrid but here's a general tip: when you specify a font for your cells or maybe for the entire grid, use a greek charset. In the LOGFONT struct there is a member called lfCharSet, if you set this to GREEK_CHARSET, the font mapper will try to give you a font that has greek characters in it. As said, i don't know the Flex Grid so i don't know how you can make it use a certain font but i guess you will know that. I hope this helps somewhat.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
How to Read a User/System Environment Variable Using c++.
getenv is not working.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
for Visual C++ try this otherwise getenv will work
using namespace System;
using namespace System::Collections;
int main()
{
Console::WriteLine();
Console::WriteLine( "GetEnvironmentVariables: " );
IDictionary^ environmentVariables = Environment::GetEnvironmentVariables();
IEnumerator^ myEnum = environmentVariables->GetEnumerator();
while ( myEnum->MoveNext() )
{
DictionaryEntry^ de = safe_cast<dictionaryentry^>(myEnum->Current);
Console::WriteLine( " {0} = {1}", de->Key, de->Value );
}
}
|
|
|
|
|
That's not C++, it looks like Managed C++ (which isn't really C++ but a different language based on it). This is the wrong forum for code like that.
Steve
|
|
|
|
|
One minute of googling turned up this code:
#include <stdio.h>
#include <stdlib.h>
extern char**_environ;
int main(int argc, char *argv[], char *envp[])
{
char **next = _environ;
while (*next)
{
printf("%s\n", *next);
next++;
}
return 0;
}</stdlib.h></stdio.h>
If you want to get the value of a specific variable you can use GetEnvironmentVariable()
|
|
|
|
|
I had created variable in user section , using the following code
'defining variables
dim objShell, colUserEnvVars
'initializing all variables
Set objShell = WScript.CreateObject("WScript.Shell")
Set colUserEnvVars = objShell.Environment("System")
'Output File for registry information.
colUserEnvVars("rahul") = "rahul"
but i cannot read the same from c++, for this i have to restart the system,
but Wscript.Echo colUserEnvVars("DeloitteAuditShare123") read the value without restarting ths system.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
GetEnvironmentVariable( ) will work from VS2005 onwards. Have you tried that.
|
|
|
|
|
VKupunaram wrote: from VS2005 onward
This API has been around since Windows NT 3.1 which was released in 1993. What makes you think that it is supported only from VS2005 onwards?
|
|
|
|
|
I am using an object of CMapStringtoString. How should I clean up the map contents in the destructor.
|
|
|
|
|