|
I'm writing a ActiveX plugin to display video, I have problem on OnDraw method, I can't refresh received images on the display zone:
//Draw method:
HRESULT OnDraw(ATL_DRAWINFO& di)
{
RECT& rc = *(RECT*)di.prcBounds;
if( ImgBuff )
{
HBITMAP HBmp = CreateBitmap(ImgBuff->width,
ImgBuff->height,
1, 32, ImgBuff->data);
DrawState(di.hdcDraw, NULL, NULL,
(long)HBmp, NULL,
0, 0,
ImgBuff->width,
ImgBuff->height,
DST_BITMAP);
DeleteObject(HBmp);
}
else
{
.......
}
return S_OK;
}
//Buffering method
//this fonction bufferise recived image in ImgBuff
FrameReady(phVideoFrameReceivedEvent_t *ev)
{
ImgBuff = ev->frame_remote;
FireViewChange();
}
Thank you to say me how to redraw a new image the display zone??
Rachid
|
|
|
|
|
Hello
my pb is:
when I create a std::map in an exe and pass it to a object's method in a DLL, I can't access to the elements of the map (it crashs after the first access).
You can try this minimal code illustrating that.
(I work under visual C++ 6, but I think it's not the reason).
the code: a main.cpp file: the "application".
dll.h and dll.cpp : the dll with the object's method:
main.cpp___________________________
#pragma warning( disable: 4786 )<br />
<br />
#include <map><br />
#include <iostream><br />
#include <string><br />
#include "dll.h"<br />
<br />
int main ()<br />
{<br />
std::map<const std::string, std::string> l_map;<br />
std::map<const std::string, std::string>::iterator it;<br />
int i;<br />
<br />
l_map["1"] = "2";<br />
l_map["3"] = "4";<br />
l_map["5"] = "6";<br />
<br />
for (it = l_map.begin(); it != l_map.end(); it++)<br />
{<br />
std::cout << (*it).first << ": " << (*it).second << "\n";<br />
}<br />
<br />
CDll obj;<br />
obj.f(l_map);<br />
<br />
std::cin >> i;<br />
return 0;<br />
}
dll.h________________________________________
#pragma warning( disable: 4786 )<br />
<br />
#include <map><br />
#include <iostream><br />
#include <string><br />
<br />
#ifdef DLL_EXPORTS<br />
#define DLL_API __declspec(dllexport)<br />
#else<br />
#define DLL_API __declspec(dllimport)<br />
#endif<br />
<br />
class DLL_API CDll<br />
{<br />
public:<br />
void f(std::map<const std::string, std::string>& p_map);<br />
};<br />
dll.cpp________________________
#include "dll.h"
<br />
void CDll::f(std::map<const std::string, std::string>& p_map)<br />
{<br />
std::map<const std::string, std::string>::iterator it;<br />
<br />
for (it = p_map.begin(); it != p_map.end(); it++)<br />
{<br />
std::cout << "DLL: " <<(*it).first << ": " << (*it).second << "\n";<br />
}<br />
}<br />
Thank you in advance for your help.
Nico
|
|
|
|
|
ledzzep wrote: You can try this minimal code illustrating that.
Its not crashing with given code. I'd tested it.
|
|
|
|
|
Did you compile the DLL with the same threading model and compiler as the EXE? If not, that's probably your problem.
|
|
|
|
|
Hello again.
A piece of "solution":
it seems only the map has this problem (but I don't try with a std::list for instance)
passing a vector of pair works.
But we loose the sort advantage of the map (I don't car in this case, ouf )
Maybye the problem is the implementation of the stl map in microsoft visual C++ 6.0 (I don't try to compile yet with other compilos)
|
|
|
|
|
I suspect you need to compile the code with a DLL version of the C run-time library. Otherwise, the EXE and DLL use different heaps, which causes problems when you pass things with heap-allocations (like STL containers, for example!) from EXE to DLL and vice-versa.
To change the run-time library version, open the project's settings and select the C++ tab. Then select 'Code Generation' in the 'Category:' drop-down list. Then, in the 'Use run-time library:' drop-down list, select 'Multithreaded DLL' (for a Win32 Release configuration) or 'Debug Multithreaded DLL' (for a Win32 Debug configuration).
HTH!
|
|
|
|
|
Bingo. I'd bet that's what's going on here.
Steve
|
|
|
|
|
See my answer here[^].
P.S. Cross-posting is considered a bad practice.
|
|
|
|
|
We need to record all javascript events fired/registered against any HTML element on a form.
For example,if there is a SELECT element on a form,and there is a javascript function registered against the onchange event of the element,we need to shortlist the 'onchange' event.
How do we do this - is there some way to identify the events against which javascript functions have been registerd for any element - (either through IHTMLDocument interface or attachEvent DOM)
The purpose is to trigger that event programmatically - i.e we would populate the SELECT element and trigger the javascript 'onchange' event(or any other 'javascripted' event for that matter) through FireEvent.
|
|
|
|
|
Compiling in VC6 with STLPORT 5.1.0 and MFC
I'm experiencing the following messages.
Anybody can help to solve this ?
xxx.obj : error LNK2001: unresolved external symbol "private: static void __cdecl stlpmtx_std::D__A::_M_deallocate(void *,unsigned int)" (?_M_deallocate@D__A@stlpmtx_std@@CAXPAXI@Z)
xxx.obj : error LNK2001: unresolved external symbol "private: static void __cdecl stlpmtx_std::D__A::_M_deallocate(void *,unsigned int)" (?_M_deallocate@D__A@stlpmtx_std@@CAXPAXI@Z)
xxx.obj : error LNK2001: unresolved external symbol "void __cdecl stlpmtx_std::__stl_throw_out_of_range(char const *)" (?__stl_throw_out_of_range@stlpmtx_std@@YAXPBD@Z)
xxx.obj : error LNK2001: unresolved external symbol "void __cdecl stlpmtx_std::__stl_throw_length_error(char const *)" (?__stl_throw_length_error@stlpmtx_std@@YAXPBD@Z)
Setting _STLP_DEBUG, things change just sligthly:
xxx.obj : error LNK2001: unresolved external symbol "public: static void __cdecl stlpdmtx_std::priv::__stl_debug_engine<bool>::_M_detach(class stlpdmtx_std::priv::__owned_list *,class stlpdmtx_std::priv::__owned_link *)" (?_M_detach@?$__stl_
debug_engine@_N@priv@stlpdmtx_std@@SAXPAV__owned_list@23@PAV__owned_link@23@@Z)
xxx.obj : error LNK2001: unresolved external symbol "public: static void __cdecl stlpdmtx_std::priv::__stl_debug_engine<bool>::_Invalidate_all(class stlpdmtx_std::priv::__owned_list *)" (?_Invalidate_all@?$__stl_debug_engine@_N@priv@stlpdmtx_std@
@SAXPAV__owned_list@23@@Z)
xxx.obj : error LNK2001: unresolved external symbol "public: static void __cdecl stlpdmtx_std::priv::__stl_debug_engine<bool>::_Assert(char const *,char const *,int)" (?_Assert@?$__stl_debug_engine@_N@priv@stlpdmtx_std@@SAXPBD0H@Z)
Maybe this could help: I've got on codeproject list a (now broken) link to a solution: http://www.codeproject.com/file/win32findfile.asp?df=100&forumid=13624&exp=0&select=925545#xx925545xx
Following it, I found this notes. However them does not suggest me any solution.
http://sourceforge.net/search/?ml_name=crayzedsgui-cvsmk2&type_of_search=mlists&group_id=93749&words=unresolved
Thank in advance ...
Andrea
|
|
|
|
|
Are there equivalent classes in WTL that replaces the MFC CFile-based classes?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
There is a CFile class written by Bjarke it must help you in your work.
You can find that here
http://viksoe.dk/code/atlfile.htm
::_-_
I believe in luck and i find that the harder I work,
the more I have of it _-_::
|
|
|
|
|
John, check out CAtlFile . Personally, I use STL streams (std::ifstream and std::ofstream ).
|
|
|
|
|
I need to use the _access function in io.h, but when I #include it, I get the following linker errors:
1>LIBCMT.lib(dosmap.obj) : error LNK2005: __errno already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(dosmap.obj) : error LNK2005: __set_errno already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(dosmap.obj) : error LNK2005: __get_errno already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encoded_null already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __get_osplatform already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __osplatform already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(calloc.obj) : error LNK2005: _calloc already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
If I *don't* #include io.h, I get a compiler error saying _access isn't defined.
If I try to #include atlmincrt.h, the compiler tells me it can't find the file, yet the ATL include folder exists in the VC++ Directories, and the file is in that folder.
Is there a secret atl include file that solves this problem?
-- modified at 16:42 Saturday 9th December, 2006
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Are you getting this error for Release builds only?
Try removing _ATL_MIN_CRT in Project -> Settings, C++ tab, from the Preprocessor definitions box. [edit]This is for VC6, but their might be something similiar in VS2005, but I don't have access to it right now[/edit]
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
What Steve said. Is VS2005, open the project settings and in the General section make sure the Minimize CRT Use is ATL is set to No.
|
|
|
|
|
That was it. Many thanks.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I'm using VS2005 Standard
I'm completely new to WTL, and have downloaded 8.0.6034 from sourceforge. How do I "install" the app wizard stuff? The installer appears to be a javascript file, but when I try to load it in IE, nothing happens. The documentation doesn't appear to say how to run these setup files.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Close Visual Studio and just double-click the "setup80.js" script.
|
|
|
|
|
Many thanks.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I don't know if this applies to 8.0, but it did to 7.x: If you want to use the ATL (& MFC)-implementation of CString, then make sure to include atlstr.h just after atlbase.h (at the very least before any of the wtl-includes). WTL has its own CString-implementation, which it'll enable if ATL::CString isn't present by the time of inclusion. This can create all kinds of bizarre type mismatches if you include atlstr.h after WTL.
--
-= Proudly Made on Earth =-
|
|
|
|
|
I want to create a child(?) window on a form that overlaps the non-client area of the main window. Similar to the Office 2007 application button (see http://images.tomshardware.com/2006/03/10/office_2007_beta_2_02.jpg).
I have tried setting the window style to WS_POPUP, but the window is still clipped to the client area of the frame. The only way I can get around this is to use a screen DC, but that doesn's seem like the right thing to do (and I have to manually determine when the window shoudl be visible so I don't draw over other windows.
Any hints would be greatly appreciated.
|
|
|
|
|
i developed an ActiveX control with ATL,vs2005
When I try to open my ActiveX Control with Dependency Walker in client machine
i got the following error:
"Failed to load due to a mismatched machine type with one or more of the dependent modules"
It need "CoreDll.dll".
I saw below article on MSDN to troubleshoot the issue
http://msdn2.microsoft.com/en-us/library/aa459142.aspx
but it looks like it is all about Windows CE and .Net compact framework. I am using Windows XP SP2.
Any help is appreciated.
|
|
|
|
|
Instead of client m/c, use dependency walker on development m/c to detect all dependencies, and ship them along with activex.
|
|
|
|
|
use dependency walker on development m/c
"atl80.dll" and "msvcr80.dll" are needed ,i ship them along with the activex ,but it can not work.
|
|
|
|