|
What Stuart said and depending on what you are using you might need to have an updated Platform SDK[^] from the original VC6
|
|
|
|
|
I am using original version. The auto generated code only shows the error(defined in #).if i remove that then it is compiled.
|
|
|
|
|
suthakar56 wrote: I am using original version. The auto generated code only shows the error(defined in #).if i remove that then it is compiled.
I have no new information. Follow the advice previously given by myself and Stuart.
|
|
|
|
|
Good point - I forgot that one. So long since I used VC6....since I moved to VS2003, I've always used a Visual Studio newer than my standard target (Windows 2000 - we've not managed to make the giant leap to XP or Vista at the company I work for).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I compiled the idl file and it creates server and client (ie client_c.c and server_s.c) stub files.Client stub file is working properly in application.But In server stub file Interface definition is not implemented(generated code).(I created idl file project type is ATL COM AppWizard and server type as Service).
Regrads,
Suthakar
|
|
|
|
|
suthakar56 wrote: But In server stub file Interface definition is not implemented
What do you mean by 'not implemented'?
I just tried a quick sample of IDL, which I processed with midl /server stub /client stub a.idl - seemed to have the correct server marshalling code.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I just compiled .idl by vc++ editer itself.It creates the client and server stub files.I want to know that whether i should compile .idl file using midl compiler only or the the first is enough.
Not implemented -->The function(idl) definition is implemented in server stub file (in my sample code).But original code it was not there.
|
|
|
|
|
suthakar56 wrote: I just compiled .idl by vc++ editer itself.It creates the client and server stub files.I want to know that whether i should compile .idl file using midl compiler only or the the first is enough.
VC++ uses MIDL. That's fine.
suthakar56 wrote: Not implemented -->The function(idl) definition is implemented in server stub file (in my sample code).But original code it was not there.
Can you explain what you mean by 'But original code it was not there'
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I am already having some sample code for RPC which executes perfectly.But my RPC server stub code, implementation of idl function definition (ie auto generated) was not there.
|
|
|
|
|
So - do you mean there was no whatever_s.c file? Or that it was empty? Try posting your IDL, and look in your VC++ project settings for that file to see what the command line to compile the IDL is and post that.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi, now server is working fine but in client side it through an exception while running with breakpoints in client stub file.The idl file is as follows
[ uuid (id),
version(1.0),
pointer_default(unique)
]
interface myidl
{
typedef struct
{
int data;
}DATA_ST;
void function([out] [in] DATA_ST *,DATA_ST);
}
NdrNsGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, myidl__MIDL_AutoBindHandle );
while running this above function it through the exception " Runtime reported exception 0x6e2 = 1762.I want to know how the synchronization is maintained between client and server.
|
|
|
|
|
suthakar56 wrote: I want to know how the synchronization is maintained between client and server.
By maintaining a single thread of control between client and server - the calling thread on the client side waits while an RPC call is made.
suthakar56 wrote: void function([out] [in] DATA_ST *,DATA_ST);
Should that be
void function([out] DATA_ST *,[in] DATA_ST); ?
suthakar56 wrote: Runtime reported exception 0x6e2 = 1762
Error 1762 == RPC_S_NAME_SERVICE_UNAVAILABLE . Means it can't find the server, I think.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi Stuart, The problem is solved.As a beginner,I missed the .acf file.So that the problem is created.Now this is working fine.Thank you for your replies.
|
|
|
|
|
Good! Well done for sorting it out!
suthakar56 wrote: As a beginner,I missed the .acf file
I've never used an acf file when I've used MS-RPC - I guess the situations where I've used RPC have been simple enough for me to get away without one.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi There !!!
Let's find someone who could help me on this problem.
I have created on VS2005 under Windows Vista a new Visual C++ ATL Server Web Service Project with:
Blob Cache
Session Services (Memory-backed session-state service)
I compiled the project sucessfully. Then, i opened IExplorer and access de URL to generate the WSDL.
The WSDL of the web service was generated with sucsess.
This is my problem:
With this simple and basic project, i changed the configuration properties to support Common Language Runtime Suport, Old Syntax (/clr:oldSyntax)
The compilation of the project was made successfully.
The problem was when i go to access the web service to generate the WSDL via web browser.
I access the URL (something like: http://localhost/ATLWS1/ATLWS1.dll?Handler=GenATLWS1WSDL) on IExplorer, and the web browser hangs and no result is returned.
Just a page indicating that "Internet Explorer cannot display the webpage".
There some dependency or configuration missing to support CLR ?? I tried the same scenario on Windows XP and this works fine.
|
|
|
|
|
Hi, (cross-post with web-dev)
I'm trying to detect if my ATL control is installed on the users system in IE8. I am using the following vbscript code:
function DetectActiveX (controlName)
on error resume next
dim res
res = 0
if IsObject(CreateObject(controlName)) then
res = 1
end if
DetectActiveX = res
end function
The problem is that the detection fails if the control has been installed by the user running firefox (or any other non-IE browser) and when the user later returns to the same page using IE8.
This is because IE8 blocks the object creation with an "Add-on disabled, Run add-on?" drop down info bar. My javascript/vbscript has no way to detect this situation, so i force a download ... which is is at best confusing to the user.
Anyone have a suggestion on what else i could try? Since my previously run installer has binary access, perhaps it needs to register something extra with IE8/windows when installed outside of the IE8 process?
Thanks,
Chris
|
|
|
|
|
|
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
|
|
|
|