|
|
We have been encountering crashes in ATL conversion macros where the ATL library function pointer g_pfnGetThreadACP points not to an actual function but into thin air. The call through g_pfnGetThreadACP can be eliminated by compiling with _CONVERSION_DONT_USE_THREAD_LOCALE defined, but this loses the thread-specific code page in our multithreaded programs. There is no compiler option to simply use CP_THREAD_ACP, although the restriction to Windows 2000 and later would be more than enough for our needs.
The programs that have been crashing are compiled with Visual Studio 2005 in release build; debugging builds and similar programs compiled with Visual Studio 2003 do not crash. All programs that have crashed use an in-house port of Objective Grid 9.02 to VS8 which we have used for over a year but programs only just started crashing so there must have been something else that has changed. All crashes have either been when the program has been initializing (MFC InitInstance()) or closing down.
Has anyone got any ideas?
|
|
|
|
|
1. Trace into the code and find why g_pfnGetThreadACP isn't being set.
2. Set a data breakpoint on g_pfnGetThreadACP and find what's zeroing it out.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I have a flash activeX integrated into my application. I can run local files without any problems. But I can't run swf files directly from the internet. Its a non-MFC based app using ATL.
When I try to run swf directly form the internet by passing a URL (www.somelink.com/flash.swf) to put_Movie, the flash player goes into ready state 3 which means "intereactive" (I can't seem to find any details on what this means). But nothing gets downloaded from the internet and the ready state does not reach 4 "complete" even if I keep waiting for some time.
I have also tried using LoadMovie(0, url) but that does the same thing (ready state 3). I know that the flash player that Adobe provide (desktop app) downloads and plays movies from HTTP URL's.
So am I missing something basic here? Does the flash activeX download movies or is this implemented separately in Adobe's flash player app?
I am not using IShockwaveFlashEvents and do not implement its OnProgress method. Is this what is stopping activeX from downloading the swf?
Any help with this will be much appreciated.
Thanks,
Hasan.
|
|
|
|
|
The test is copy a string of 1023 bytes 1M times.
The code is compiled with VC9 compiler.
std::string knows the size of the string ahead, why it is much slower
than memcpy_s (it can call memcpy_s in the implementation, right?),
In the debug version, the the difference of speed is about 15%,
but in release version it is about 50%. Why?
Here is the testing code:
#include <stdio.h>
#include <stdlib.h>
#include <tchar.h>
#include <conio.h>
#include <assert.h>
#include <string>
#include <windows.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char buf[1024];
for (int i=0; i<sizeof(buf); ++i)
buf[i] = rand()%26+'a';
buf[sizeof(buf)-1] = 0;
size_t nStrLen = strlen(buf);
printf_s("str:\t%s\n", buf);
printf_s("strlen:\t%u\n", nStrLen);
char buf2[1024];
DWORD nTicks;
int n = 1000000;
nTicks = GetTickCount();
for (int i=0; i<n; ++i)
strcpy_s(buf2, sizeof(buf2), buf);
nTicks = GetTickCount()-nTicks;
printf_s("strcpy_s time:\t%u\n", nTicks);
assert(strcmp(buf, buf2)==0);
nTicks = GetTickCount();
for (int i=0; i<n; ++i)
strncpy_s(buf2, sizeof(buf2), buf, nStrLen);
nTicks = GetTickCount()-nTicks;
printf_s("strncpy_s time:\t%u\n", nTicks);
assert(strcmp(buf, buf2)==0);
nTicks = GetTickCount();
for (int i=0; i<n; ++i)
memcpy_s(buf2, sizeof(buf2), buf, nStrLen+1);
nTicks = GetTickCount()-nTicks;
printf_s("memcpy_s:\t%u\n", nTicks);
assert(strcmp(buf, buf2)==0);
string s(buf);
string s2;
nTicks = GetTickCount();
for (int i=0; i<n; ++i)
s2 = s;
nTicks = GetTickCount()-nTicks;
printf_s("string:\t%u\n", nTicks);
assert(strcmp(buf, buf2)==0);
_getch();
return 0;
}
|
|
|
|
|
Its probably because an strcpy has to iterate from the specified starting address till the null terminating character. Whereas for memcpy, you specify both the starting address and the number of bytes to copy.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
followait wrote: std::string knows the size of the string ahead, why it is much slower than memcpy_s (it can call memcpy_s in the implementation, right?),
In the debug version, the the difference of speed is about 15%, but in release version it is about 50%. Why?
If you trace through the disassembly, you find that std::string does call memcpy - it's just that it does a lot of other stuff - and looking at the disassembly of the C++ run-time library, MSVCP90, it doesn't inline aggressively, so there's a lot of calls incurred, which aren't too knd to performance...
BTW - what compiler options did you use? I used several sets - here are a couple of them (these trials used 10,000,000 iterations):
cl -MT -Ox -Ob2 -EHsc -Zi a.cpp
leads to
memcpy_s: 2000
string: 1078
cl -MD -Ox -Ob2 -EHsc -Zi a.cpp
leads to
memcpy_s: 610
string: 1062
So - just a runtime library change...go figure!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
release version:
/O2 /Oi /GL /D "WIN32" /D "NDEBUG" /D "_CONSOLE"
/D "_UNICODE" /D "UNICODE" /FD /EHsc /MD /Gy /Fo"Release\\"
/Fd"Release\vc90.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt
debug version:
/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"
/D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\"
/Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt
BTW, in your tests, why /MD is faster /MT for memcpy_s ?
modified on Friday, June 12, 2009 9:41 PM
|
|
|
|
|
followait wrote: BTW, in your tests, why /MD is faster /MT for memcpy_s?
I'm not sure why those figures occur - when I rerun them now, I get std::string being consistently faster. As I said - go figure
There's probably something about the benchmark that's not quite true to life...or something.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I'm new in ActiveX and all these things... So...
I'm developing ActiveX control in ATL, that uses Direct3d.
I'm emebeding control in VB application. Everything is ok in run mode. But when I'm coming to form design mode - this control totally freezes Visual Studion. Then it can be closed only with task managers.
Anyone had such problem?
Thanks
|
|
|
|
|
Hi
ArchiveController.obj : error LNK2001: unresolved external symbol _WndProcThunkProc
Manager.obj : error LNK2001: unresolved external symbol _WndProcThunkProc
ServerObj.obj : error LNK2001: unresolved external symbol _WndProcThunkProc
Mager.obj : error LNK2001: unresolved external symbol _WndProcThunkProc
ServerObj.obj : error LNK2001: unresolved external symbol _WndProcThunkProc
Controller.obj : error LNK2001: unresolved external symbol ._WndProcThunkProc
ager.obj : error LNK2001: unresolved external symbol ._WndProcThunkProc
verObj.obj : error LNK2001: unresolved external symbol ._WndProcThunkProc
nager.obj : error LNK2001: unresolved external symbol ._WndProcThunkProc
ger.obj : error LNK2001: unresolved external symbol ._WndProcThunkProc
ReplObj.obj : error LNK2001: unresolved external symbol ._WndProcThunkProc
Iam struck with this error while using psdk 2003 on vc6.0 for 64bit.
same error is not seen with vc 6.0 32bit compile.
|
|
|
|
|
unresolved external symbol: something is missing
._WndProcThunkProc: that the name of it
I guess you missed including some ATL-libs in the project settings
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I think the out and input should be exchanged for stream in STL.
Take cin for example, the stream is from cin to memory,
just as the code shows:
cin >> i;
The stream is out from cin, so I think the name should be cout (relative to itself), then the code will be:
cout >> i;
Simpler, isn't it?
|
|
|
|
|
No. cin == "console input", cout == "console output". The stream names define the flow of information relative to the program, rather than from the stream's point of view.
I doubt you'll find any programming language where sending data to a stream is described as 'input' rather than 'output'.
|
|
|
|
|
I think 'relative to the stream' is better than
'relative to others'.
It's OO, isn't it?
|
|
|
|
|
followait wrote: I think 'relative to the stream' is better than 'relative to others'.
So...the stream should be named relative to itself? In that case it should be called 'me'. In fact, every object, if named relative to itself, should be called 'me'.
No - names of objects are selected based on the programmers viewpoint - which is the program. cin is your program's viewpoint of console input, so its name ought to reflect that. Similarly, cout is your program's viewpoint of console output.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I tried as below, but ostream cannot be instantiate?
ifstream ifs1("file1");
ifstream ifs2("file2");
ostream oss;
oss << ifs1 << ifs;
|
|
|
|
|
ostream is an abstract base class - that's why you can't instantiate it. Also, you can't use the insertion operator on streams to get what you're wanting.
So...what do you mean by "memory binary stream"? If you were using strings, then this should work:
ifstream ifs1("file1");
ifstream ifs2("file2");
ostringstream oss;
std::copy(std::istream_iterator<char>(ifs1), std::istream_iterator<char>(), std::ostream_iterator<char>(oss));
std::copy(std::istream_iterator<char>(ifs2), std::istream_iterator<char>(), std::ostream_iterator<char>(oss));
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
i have a composite control wich include progress bar and button, now the problem is
how can i draw same text on top of my progress bar. (m_MyProgress.SetWindowText("XXXX"))
has no effect!
any ideas?
Best Regards,
komofilms
|
|
|
|
|
You need to subclass the progress bar and override its WM_PAINT handler to draw the text - it won't do that by default.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Please help to create the machine certificate as I am working on AD RMS,I have installed the Virtual PC now I want to beging with coding in AD RMS project ........So I need to create Machine certificate and to have RAC..............
Help me Out ................
|
|
|
|
|
Your question has nothing to do with ATL/WTL/STL. In addition it seems that you have asked this same question several times. I have given you a generic answer[^] in the past. In the future you need to be more specific and describe the problem you are having with greater detail.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi,
I have created ATL project as a server (.exe) and add Simple Object in it with Aggregation,SupportInfo,Connectable objects. Now I trying to write Addin for Word,Exccel and PPT. I have created same project for all three applications. Now I want add these 3 applications interfaces and events in a single application, which i created first. Now I am trying to add Interfaces of Word into a main file by adding its interfaces and events information in mail applications .h file. I am expecting it should create .idl from it and it will contain all the interfaces of word.
But the problem is when I am compiling the code it first overrites the .h file where I have added Interface and events for word. Also I have added _cp.h, .h and .rgs files for word but it gives me following error
"error MIDL2337 : unsatisfied forward declaration :" or undeclared interfaces.
Pls let me know how can i add all these three applcaitons Interfaces and events into a single application.
Thanks
SNI
|
|
|
|
|
SNI wrote: I am expecting it should create .idl from it and it will contain all the interfaces of word.
What makes you think that? YOU create the IDL in an ATL project and IDL generates the C and H files.
Do you actually need the Word, Excel and PowerPoint items in the IDL? If not, then I'd use #import[^] in the .cpp file to reference them.
|
|
|
|
|
Hi,
I have a simple ATL server project created with VS2008 (e.g. IDummy)
with an connection point event (e.g. Fire_test) and a stand-alone thread.
My thread should notify all connected clients with the specified event.
How can I accomplish this?
Maybe using EnumConnectionPoints, but how?
Any examlples?
Thx in advance
|
|
|
|