|
hello everyone:
How to change title text of dialog in a wtl project?
Thank you.
-Freehawk
|
|
|
|
|
SetWindowText() ?
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
Thank you for the reply
I tried it in a docking window, but nothing was changed.
Maybe there is other problem.
-Freehawk
|
|
|
|
|
sir,
i am a student and doing my project as a part of my course in one of the firms.i am doing it by using VC++ with MFC.but if i try to execute stl data viewer code,i will be getting the following errors.kindly provide the solution for the same.
StLViewerView.obj : error LNK2001: unresolved external symbol "public: void __thiscall CView::OnFilePrintPreview(void)" (?OnFilePrintPreview@CView@@QAEXXZ)
StLViewerView.obj : error LNK2001: unresolved external symbol "public: void __thiscall CView::OnFilePrint(void)" (?OnFilePrint@CView@@QAEXXZ)
StLViewerView.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CView::PostNcDestroy(void)" (?PostNcDestroy@CView@@UAEXXZ)
StLViewerView.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CView::PreCreateWindow(struct tagCREATESTRUCTA &)" (?PreCreateWindow@CView@@UAEHAAUtagCREATESTRUCTA@@@Z)
StLViewerView.obj : error LNK2001: unresolved external symbol "public: int __thiscall CView::OnCreate(struct tagCREATESTRUCTA *)" (?OnCreate@CView@@QAEHPAUtagCREATESTRUCTA@@@Z)
StLViewerView.obj : error LNK2001: unresolved external symbol "public: void __thiscall CView::OnDestroy(void)" (?OnDestroy@CView@@QAEXXZ)
Debug/StLViewer.exe : fatal error LNK1120: 6 unresolved externals
--ramya
|
|
|
|
|
hello everyone:
I have a wtl project and need a help file like treeview to display, but I dont know how to do.
I want to create a treeview like the "index" of MSDN, Could you teach me?
Thank you.
-Freehawk
|
|
|
|
|
There are plenty of WTL code examples here on Code Project that you should be able to get an idea of how to go about doing this ...
As for "teaching you" how, that's probably not going to happen. Some suggestions off the top of my head, however, would be to:
1. Implement your help system as a set of web pages and just use a HTML view/pane in your application, see the Code Project WTL[^] area for code examples
2. Use HTML Help Workshop[^] to compile your HTML file and just hook it off a standard 'Help Menu' bar item (that builds "MSDN like" help files)
D.
|
|
|
|
|
I have a Browser Helper Object that I have created and I want it to create a Window using the API function CreateWindowEx so that I can using the window layering extended style described here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/layerwin.asp
My question is how do I create a window using this API in my ATL project? I have tried creating a class that inherates from CWindows and then using the http://www.codeproject.com/w2k/QDWndTransparency.asp?print=true
But this does not have the same effect. I really need a faded window using:
hwnd = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT,
gszFade, gszFade, WS_POPUP | WS_VISIBLE, prc->left,
prc->top, 0, 0, NULL, (HMENU)0, ghinst, NULL);
My goal is to have a window placed over the browser main window that I can then draw on. Any suggestions?
Thank you much,
Mike
|
|
|
|
|
Try this:
typedef BOOL (__stdcall *PFUNCSETLAYEREDWINDOWATTR)(HWND, COLORREF, BYTE, DWORD);
PFUNCSETLAYEREDWINDOWATTR m_pfSetLayeredWindowAttributes;
HMODULE hUser32 = GetModuleHandle(_T("User32.dll"));
if (hUser32)
{
m_pfSetLayeredWindowAttributes =
(PFUNCSETLAYEREDWINDOWATTR)::GetProcAddress(hUser32, "SetLayeredWindowAttributes");
if (m_pfSetLayeredWindowAttributes)
{
::SetWindowLong(m_hWnd, GWL_EXSTYLE, GetWindowLong(GWL_EXSTYLE)^WS_EX_LAYERED);
// After the SetWindowLong call, the layered window will not become visible
// until the SetLayeredWindowAttributes function has been called for this window
m_pfSetLayeredWindowAttributes(m_hWnd, 0, (BYTE)255, LWA_ALPHA);
}
}
and then somewhere
// Sets the transparency of the window
void MakeTransparent(int nAlpha)
{
if (m_pfSetLayeredWindowAttributes)
m_pfSetLayeredWindowAttributes(m_hWnd, 0, (BYTE)nAlpha, LWA_ALPHA);
}
|
|
|
|
|
I hae a DLL made from ATL Com appwizard, supporting connection points...
<br />
<br />
void OnAParticularFunction() <br />
<br />
Fire_Event();<br />
<br />
}<br />
NOw the code fragment generates an exception..
Why does it generate an exception? is it because of the fact the function from where the event was fired, is running on a separate thread? If so, how could i work this thing out?
tnx inadvance
|
|
|
|
|
Maverick wrote:
is it because of the fact the function from where the event was fired, is running on a separate thread?
Yes. My guess is that your threads live in separate apartments.
Please see this[^] article for a discussion and solution on how to fire events across apartment boundaries.
--
Gott weiß ich will kein Engel sein.
|
|
|
|
|
I have a cedit view, and I want to set the forcus to special place where I hope,
Could you help me how to do it?
Thank you.
-Freehawk
|
|
|
|
|
Define "special place." Are you referring to hilighting?
Kuphryn
|
|
|
|
|
Thank you for the reply.
I only want to place the forcus to a special.
Now I made the source code as the following:
Example:
SetSel(1,1)
is the way right?
-Freehawk
|
|
|
|
|
Hi everyone,
I hope there's someone out there, who can help me with my problem, I've asked about this in the COM forum, but no one knows or cares to reply.
I have an ATL control, which should communicate with Macromedia's Flash control. I generated the IDL file and the event interface (based on IDispatch) has a few custom methods in it. When I use MIDL these custom methods nor the dispids are present in the .h file.
Is this correct behaviour? I could ofcourse add the methods to the interface and then base my event sink on that or am I supposed to do it with the IDispatch and thus responding to those methods when invoke is called?
.NET and VB provide actions for these events directly, but I need to use ATL for the task and would really like to understand the internals, rather than pick the quick and easy way out.
Even links to c++ sourcecode interfacing with Flash would help me out.
Thanks in advance!
|
|
|
|
|
Must've missed this one.
When you say the custom methods and dispids are missing from the .h file, does that mean you only see the dispinterface as IDispatch in there?
Have you tried using #import on the typelibrary (or DLL if there isn't an explicit one) and looking at the tli/tlh files generated to see if they are any different?
If you use OLEVIEW and examine the IDL of the Flash control, is it different, or is that what you used to generate it in the first place?
Worst case is, as you say, to have your own IDispatch; initially it could just dump out the events that are sent to it, so you can at least confirm it's behaving as expected.
Steve S
Just waiting for the day when someone asks a non-urgent question...
|
|
|
|
|
Sorry for the stream of consciousness, I used the OLEVIEW to generate the IDL for Macromedia Flash control and after using MIDL to generate the header, it contains only the IDispatch interface.
As I'm an ATL/COM newbie, I just wanted to get this right in the first place, I can add the methods to the generated class and then base my sink on that, but I have a feeling this isn't the right way to do it.
I'll probably add the dispids for the Flash events as constants and test with a IDispatch, still I want to know whether this is expected behaviour when compiling an IDL file.
|
|
|
|
|
Better than an stream of unconsciousness...
That would be _IShockwaveFlashEvents, then?
I've repeated what you've done, and also #import-ed the OCX, and examined the generated file. In each case, the sink is empty. I've also tried tweaking the IDL to remove the "hidden" keyword, but this made no noticeable difference.
I'd go with plan B, and test with an IDispatch. I've looked at much of our code here, and that's how we tend to do things; a hand-crafted invoke function that then calls the appropriate functions.
Steve S
|
|
|
|
|
Steve,
thanks a million!
It's always nice to share the burden with someone 'in the know'.
Would you recommend using the dispids from the IDL file or should I implement the GetIDsOfNames in my IDispatch? I'd presume Flash would be using the predefined IDs in the invoke calls rather than asking for the ids I've chosen myself, afterall it's Flash's interface I'm playing with.
And one final note, is everyone using VB and .NET to do this? Is the C++ implementation a well kept secret or what? I thought this would be something a lot of people had done before and still Google was unable to give me anything else than this same question asked over and over again.
If someone is looking for an idea for an article here, this could be it; communicating with Flash using SetVariable and catching the FSCommand event. Quite trivial to implement, yet causing confusion among many developers.
|
|
|
|
|
Didn't realise I was 'in the know'!
You can just use the dispids from the IDL, preferably, as you said before, defined as constants somewhere. Flash will be using the predefined IDs, so it will be safe, and it's much less painful than implementing GetIDsOfNames, which you won't need.
Don't know about the final note, I only use C++/C/C# with VBS thrown in.
For what it's worth I usually 'handcode' the event sink so that the invoke function calls a pure virtual in a base class, then my concrete class provides the pure virtuals. This is occasionally useful if I need the same kind of sink somewhere else in the project or another app.
Steve S
|
|
|
|
|
Has anybody tried to make the *subj* for MDI? If so, coul anyone provide me with the reference.. And I hope the topic would be interesting for all WTLians, not only for beginners like me..
Thank you in advance.
Best wishes for all --
ScD
|
|
|
|
|
dfsdfsd;)
|
|
|
|
|
Is there any documentation on the thread safety of the Dinkumware STL library distributed with VS.NET 2003?
-Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Dinkumware's STL is thread-safe in a very weak manner: if thread A uses container instance a and thread B uses a different container instance b , no threading problems arise. But if the same container instance is simultaneously handled by two different threads, no guarantee is made at all: you will have to synchronize access to the container by your own.
There are good reasons for not providing stronger thread-safety: the rationale is that oftenly most of the time the program has its own concepts about what an atomic operation is, and this may involve more than one call to STL; for instance in an accounting program an atomic transaction operation involves removing an element from somewhere and inserting it somewhere else. In these situations, simple thread-safety at the call invocation level does not suffice.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
SGI docs say that read access to same container from multiple threads is safe. But, from what you mention, I assume that even that is not guaranteed by Dinkumware.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I doubt that is the case. There can never be thread errors on read only operations. I have a really hard time to believe that dinkumware STL is doing write operations behind the scenes of a perceived read only operation. Then someone ought to take the dinkumware STL authors out on a field and... But I really really really doubt anyone would do such a treacherous thing.
--
Gott weiß ich will kein Engel sein.
|
|
|
|