|
Hi Freaks,
I have a problem with a template function in a DLL. This template function is a method of a class which is not a template class. The class is part of a DLL an is properly exported (all other (non template) methods work). When this class is part of the project where I call the template function from it works too. When I call the template function in my "main" project and the class is inside the DLL I get "unresolved externals". I know that I can solve this problem by making the non template class a template class, but thats not intended.
Has anyone a brilliant idea about that ???
Thanks for help in advance... cu
-=[SKULK]=-
|
|
|
|
|
Can you post some of the code? Might have a better idea of the problem if we can see it.
|
|
|
|
|
I have two bitmaps.
How do I stretchblt one into the other?
|
|
|
|
|
I am not sure, but this can be OS/display driver dependant:
Create 2 memory DCs. Select each bitmap in his corresponding DC, then do the stretchblt between the DCs. The bitmap in the target DC will be modified.
You can the bitblt the taget DC contents into another DC (like the DC of a control/window) or unselect the bitmaps, and do what you wish with the modified one.
|
|
|
|
|
Hi,
In my application, I need to call
::EnumChildWindows(m_hWnd, SetButtonState, (LPARAM)(Info));
How can make the following function to be local:
BOOL __stdcall SetButtonState(HWND hwnd, LPARAM lparam)
to be someclass' member function like:
BOOL __stdcall CMyApp::SetButtonState(HWND hwnd, LPARAM lparam) -----> this is wrong!
Some code sample will be much appreciated!!!
Thank you very much!
|
|
|
|
|
You don't. You can't pass a non-static member function because the parameter list doesn't match (remember in C++ all non-static member functions receive a hidden first parameter, the "this" pointer). What you can do is declare write your callback like this:
BOOl __stdcall SetButtonState (HWND hwnd, LPARAM lparam)
{
CMyApp* app = (CMyApp*)lparam;
ASSERT (app != NULL);
app->SetButtonState (hwnd, lparam);
}
Then call EnumChildWindows with the global SetButtonState, like this:
::EnumChildWindows (m_hWnd, ::SetButtonState, (LPARAM)&myApp);
The global SetButtonState just redirects each call back to the object that you specified in the call to EnumChildWindows
You could also make the global SetButtonState a static member of your class.
Cheers,
Eric Tetz
|
|
|
|
|
Hi,
I was wondering if anyone had an idea of how to implement a global undo feature.
Something like what microsoft offers with all of their applications. I have an application that does some
undoing, but I would like to convert this to handle any operation.
Any suggestion is appreciated...
|
|
|
|
|
|
Is there anyone out there using the ActiveX
web browser control IWebBrowser2?
I can't seem to get the horizontal scroll bar to go away?!?!?!
|
|
|
|
|
It's been a while since I worked with it, but as I remember you don't have much control over the scrollbars. The scrollbars appear automatically if the rendered HTML file is greater in width or height than the dimensions you've allowed for the control.
Why not try making the displayed HTML page smaller?
|
|
|
|
|
The HTML page is small...the horizontal scrollbar
is appearing and is disabled when the page is small???
And for the life of me, I can't find a way to get rid
if it?!?!
|
|
|
|
|
Weird. I'll ask around and see of one of my fellow developers knows the reason.
|
|
|
|
|
Try this (from ATL Internals) (also disables right click menu)
CComPtr<iaxwinambientdispatch> spAmbient;
hr = m_axWebBrowser.QueryHost(&spAmbient);
if(SUCCEEDED(hr))
{
spAmbient->put_AllowContextMenu(VARIANT_FALSE);
DWORD flags;
spAmbient->get_DocHostFlags(&flags);
spAmbient->put_DocHostFlags(flags | docHostUIFlagSCROLL_NO);
}
|
|
|
|
|
Two methods,
1. Turn it off with HTML !
either by navigating to the appropriate page or
use MSHTML with insertAdjacentHTML method.
2. Alter the HostInfo After every Navigation the Control
reloads the DocHost info
STDMETHOD(GetHostInfo)
(DOCHOSTUIINFO FAR *pInfo)
{
pInfo->cbSize = sizeof(DOCHOSTUIINFO);
pInfo->dwFlags = DOCHOSTUIFLAG_SGROLL_NO;
return S_OK;
}
Hope this helps somehow!
|
|
|
|
|
Hi there! Is there anyway to open a unicode filename using standard C++ (no SDK/MFC please). I would like to use fstream, but the constructors for both ifstream and ofstream take a const char*. How can I pass in a wide char string containing the filename to be opened (Unicode), as this is a requirement for me? I investigated wfstream, but it seems to be just a cover-up. The doc says it's just a synonym for fstream, and moreover, if you take a look at the class definition of wfstream, you'll see that it internally uses const char* as well. Any suggestions?
|
|
|
|
|
I have a C++ dll(No MFC) in release mode. In the initialization process I read some environment variables and copy them to string variables(members of MyClass). Strangely the values are not copied to the string members. When I debugged the code(release version), the address of this pointer in the constructor of MyClass changes with each line of code!!
MyClass::MyClass
{
...
char* szEnv;
szEnv = getenv("CONFIG_PATH"); // Environment variable
m_sConfigPath = string(szEnv); // m_sConfigPath is a member variable of MyClass of type string(STL)
...
}
For testing purpose, I tried this
char szBuff[100];
strcpy(szBuff,"Hello!");
Even this failed!
Can anybody help me out?
Note: Everything works fine in debug mode.
Thanx,
Jagadish.
|
|
|
|
|
Hi all !
I have done an ActiveX control non-subclassed in which I create a Grid I've done for desktop applications. In that grid, I handle the TAB key to move in the cells and I can edit a cell with a little CEdit derived control. It works fine in destop applications, but in ActiveX control, I have some bizarre behaviours ! The TAB works one time (ie the next cell is selected), but at the second time, the grid loses the focus ! In the same way, the arrow keys don't work in the little cell edit !
Why doesn't my grid work like in a desktop app ?
Thanks for any help !!!
Emmanuel Derriey.
Windows Software Developer.
e-mail : mderriey@hotmail.com
|
|
|
|
|
I've run into this before too. I can't remember the exact solution, but I believe it requires a change to the message routing in MFC. If you do a search in MSDN for activex arrows and MFC I think the knowledgebase article will come up. If I get a chance today, I'll see if I can find the exact link to the article.
|
|
|
|
|
I have inherited some source that contains a large number of very complicated macros.
Is there a why I can print out what those macros expand to when compiled?
Thanks
|
|
|
|
|
Run cl /? and look at the switches listed in the Preprocessor section. You can send the preprocessor output to a file or stdout.
--Mike--
|
|
|
|
|
I need to read and write data in binary format, but working on any platform. For example, a file created on Windows should be read on Unix. I can’t find any info on that. Anyone can give me hints?
TIA.
|
|
|
|
|
Hmmm, I can't see why this would be any great problem. Most importantly you need to make sure that every platform uses the same format for the binary files (but that's a given).
Platform to platform you're going find differences in the number of bits used to represent a value, how arrays are stored, and the whole big-endian, little-endian thing as well.
I think if you stick to using 8 bit bytes and use your own routines for building the binary files, you should be ok?
|
|
|
|
|
Goto
http://chesworth.com/pv/downloads/libs.htm
and download bllib11.zip
This will give you a start.
|
|
|
|
|
Hello,
I would like to hide my application from the taskbar when the user decides to minimize it (and show an Icon in the SystemTray instead - but I don't need help with this).
So how can I make sure, my application does not appear on the taskbar and in the window that is shown when the user presses ALT+TAB. But this only if the window is minimized.
I know that it has been posted already somewhere somewhen, but I really couldn't find it
Best wishes,
Matthias
|
|
|
|
|
Add the extended style WS_EX_TOOLWINDOW to your Mainframe window. I think that'll do it.
|
|
|
|