|
Hi all,
While working with print templates I got into a situation where my JavaScript loaded ActiveX control was not filling my m_spClientSite with a value other than NULL.
After wrestling with it for a while I decided to take a back door. It was necessary for me to access the COM interfaces in my instance of IE so I went to the Running Object Table. I enumerated its contents and was relaxed when I saw 3 IE entries as that was the number of IE windows I had open. Each one had been opened from the other. My problem is that all the IE objects in the ROT have the values of the first IE window opened (unfortunately not the one I wanted).
So my question is: is there a way of access the other IE COM interfaces?
Or even more helpful: what's the procedure when you control hasn't got a useful value in its m_spClientSite.
Thanks loads for any help
Tom
|
|
|
|
|
As I understand it you want to access IE interfaces from an ActiveX control hosted by it but IOleObject::SetClientSite hasn't been called on your control yet. This is a situation that should never happen, something is going wrong - perhaps your code is trying to access IE's interfaces before the control is hosted properly. My advise would be to try to find the source of the problem and not "hack around" it - You'll just make more trouble for yourself.
Steve
|
|
|
|
|
Thanks Steve.
That which should never happen seem to be a common occurance using print templates though.
Tom
|
|
|
|
|
i not want use
void a()
{
}
void b()
{
}
a_funlen = b - a
|
|
|
|
|
What is your question?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
|
|
|
|
|
a function compile and link, in exe's length
int fun()
{
__asm mov eax, 1
__asm ret 0
}
mov eax, 1 == b8 01 00 00 00
ret 0 == c3
so the fun length is 6
|
|
|
|
|
The best way is to have the compiler produce assembly code. Go to project properties | C/C++ | Output Files | Assemler Output. Select "Assembly, Machine-Source and Code." The output will be ".cod" files in your object directory.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
How can I tell MessageBox() to switch to next row?
I tried "\n" and it seems not working.
|
|
|
|
|
Sometime you have to use \r\n
(or \n\r... I don't remember)
Bye
Have a nice code day
|
|
|
|
|
what about in an editbox? how can I tell it to switch the line?
|
|
|
|
|
well, if you found a solution on the messagebox, then use the same solution there.
I suppose that is needed \r\n .
Have you already tryed, and it doesn't work?
Have a nice code day
|
|
|
|
|
I will try it after work, no C++ in my office.
Thanks
|
|
|
|
|
Make sure you have multiline selected for the edit box too...
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I just tried, it works like a charm, big help!
|
|
|
|
|
\n is normally only for consoles in win32.
The win32 user interface is working with \r\n.
Don't try it, just do it!
|
|
|
|
|
Following should work.
MessageBox("First line\nSecond line");
We Believe in Excellence
|
|
|
|
|
Aqueel wrote: MessageBox("First line\nSecond line");
some time not
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I have a project coded in Visual Studio 6, now I just installed Studio 2005 and when I compile it, it gives me the following error, although I did not modify the source code at all.
Error 2 fatal error LNK1181: cannot open input file '.\Debug\APPMODUL.obj'
I also get a warning:
Warning 1 warning LNK4076: invalid incremental status file '.\Debug/pmt.ilk'; linking nonincrementaly
and I don't know why this appears either. Maybe someone can help me pls?
|
|
|
|
|
When you open your project in Studio 2005, just delete 'debug' folder from project folder. and then rebuild your project and solution.
-Malli...!
|
|
|
|
|
Hi all,
does anybody knows if it is possible to have different behaviour of a function in template classes ?
I need to control the flow in differen cases.
I need something like this example (where I used a pseudo code format)
template <typename MYTYPE>class CMyClass{<br />
MYTYPE var;<br />
...<br />
void fun(){<br />
CString str;<br />
if(MYTYPE == int) str.Format("%d",var);:|<br />
if(MYTYPE == float) str.Format("%f",var);:|<br />
if(MYTYPE ???) str="Unable format conversion";:|<br />
}<br />
...<br />
}
Have a nice code day
|
|
|
|
|
Hello _Russell_,
What you need is known as "explicit template specialization". Define each specialized version of "void fun()" as follows :
void CMyClass<int>::fun()
{
str.Format("%d", var);
}
void CMyClass<float>::fun()
{
str.Format("%f", var);
}
Best Regards,
Bio.
-- modified at 7:08 Tuesday 21st February, 2006
|
|
|
|
|
|
Thanks friends,
It works.
But let me know if are possible other solutions, expecially if exist a way similar to the way that I used in the first message (if it exist then in some cases it can be a very fast way to write code!)
Have a nice code day
|
|
|
|
|
Yes, you can use a policy-based design as one way to solve this:
template <class T> struct format_string
{
LPCTSTR get_string() { assert(false); }
};
template<> struct format_string<int>
{
LPCTSTR get_string() { return _T("%d"); }
};
template<> struct format_string<float>
{
LPCTSTR get_string() { return _T("%f"); }
};
template<class T, class policy=format_string<T> > class foo
{
public: void fun() { CString s = policy::get_string(); }
};
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hello
I create a CSocket object then I post it to a thread but when I post it to thread, posted object(pointer) is not valid in thread
how can I create a socket out of thread and send it to thread?
thanks
Mehrdad
|
|
|
|