|
From MSDN [^]:
ProgIDs present a human-readable version of the class identifier (CLSID) used to identify COM/ActiveX objects.
deadlyabbas wrote: By the way how to get to know that the ProgID is valid or not and if not then what is ProgID
OleView tool helps. You may also have a look at the registry.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
deadlyabbas wrote: But I am getting an " HRESULT hr as an "Invalid class string"
I believe ProdID is should be something like this :
LibrarayName.InterfaceName.Version adn for version independent
LibraryName.Interface
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi!
I'm executing 3rd party software from Windows service with CreateProcess() on a random environment. Sometimes the 3rd party software or the environment is not stable and a runtime error is thrown, eg. R6034.
The error will cause a popup window to appear on the desktop of interactive user. The service is running on a dedicated account and it doesn't seem to have any access to WinSta0 desktops, but the popup is still drawn on WinSta0\Default.
What I'd like to do, is to handle the error on the process calling CreateProcess and prevent the popup window from appearing to interactive user. I'm currently able to detect the error and handle it, but I still have to close the popup manually.
Is there any method to
1) prevent the runtime error popup window from appearing?
or
2) force the popup window to "appear" on the invisible windowstation/desktop of the service? (where it could be signalled to close)
Thanks in advance!
|
|
|
|
|
What i understood from your query is that, 3rd party software is making error, when it is not having enough access.
Why don't you check the access information of process before calling the CreateProcess ?
Величие не Бога может быть недооценена.
modified on Thursday, August 27, 2009 4:20 AM
|
|
|
|
|
The process should have access to everything it needs, but the process may be faulty (eg. manifest errors), or the environment may lack something (DLLs etc.), which will cause the runtime error to appear.
The process can be almost anything, for example it may contain a rarely used DLL which causes the runtime error thrown once and then. In the largest cases there can be hundreds of megabytes of DLLs in separate runtime libraries, and a runtime library may be the one causing the runtime error.
It's not possible to check the validity or stability of the 3rd party software in advance, so the only option is to handle the error when it occurs.
But thank you for your quick answer!
|
|
|
|
|
3rd party softwares are not usually used by standard softwares, until you have the source code or you are confident about it.
Validity can checked directly only if you have the source code of 3rd party.
But yes you can check whether it is having stability whether all the dependent DLL are available in this system. PE file parsing is enough for checking the stability, just refer the article(Parse a PE (EXE, DLL, OCX Files ) and New Dependency Walker[^])).Just check whether the all the dependent DLL are available and they are stable.
But that is a complex solution, and i don't prefer that too.
That is what you can do. But i don't think you have any direct way to check the validity of the that 3rd party software.
Величие не Бога может быть недооценена.
|
|
|
|
|
Unfortunately that's not possible.
The 3rd party software can be for example a compiled MATLAB code which depends on Matlab Runtime Libraries. Let's say that one of the Matlab Runtime Library DLLs causes runtime error when used from service account, and it's ok as long as the DLL is not used. But if the MATLAB code uses a function call that causes the DLL to be loaded, the problem occurs.
|
|
|
|
|
Since you don't have the code to know when it is loading the runtime lib, there is not much left other than some nasty stuffs like API hooking., which is not done in any standard application.
Величие не Бога может быть недооценена.
|
|
|
|
|
Heh, some nasty trick is actually the thing I was expecting to solve this problem.
I'm already creating a remote thread to register UnhandledExceptionFilter and some other dark-side stuff, and they help to solve some other similar issues. But even these methods are helpless with the runtime errors.
|
|
|
|
|
As from your earlier information what i understood is that, when you are trying to load MATLAB runtime library(example case you specified) in service account, it is popping the error, if so hook the DLL loading function( if it is LoadLibrary , if it is then you can refer this article API Hooking (LoadLibrary)[^] ) and stops the loading by checking the account is service account or not.
Or if you have a overview, which API invocation creates errors, then hook that API( redirect the API to ur function, where you can check the the account is service or not.)
Величие не Бога может быть недооценена.
|
|
|
|
|
Thanks for a good tip, but unfortunately the MATLAB and DLL loading was just an example among the cases. As I said, the process to be called can be almost anything. That's why I'd need some generic solution to prevent all the different runtime error popups from appearing in all the possible situations. That would probably mean hooking a lot of functions.
The execution happens in cloud-like environment (both cloud-dedicated and non-dedicated). The applications executed there should be valid and stable, but that can not be guaranteed in all the situations. Therefore all the unexpected errors should be handled without any user interaction.
|
|
|
|
|
From the last reply i am doubted whether you just want to close those error windows, without human interaction, that is the only need?
Величие не Бога может быть недооценена.
|
|
|
|
|
The best solution would be to prevent the error windows from appearing at all and make the error just return some exitcode. The other option would be to redirect the popup to a non-interactive desktop and then signal them to close. I'd like to avoid any solutions that make them appear on the interactive desktop, even if they would be closed automatically.
I'll have to see if there's any generic method in error handling I could hook. I'm just little bit worried that the handling of runtime errors may be too deep in kernel(?)
|
|
|
|
|
Exactly as know, we don't have generic solution. Usually we redirect the popups, but in some extreme cases, we have to go the low level.
Величие не Бога может быть недооценена.
|
|
|
|
|
I'm trying to develop a two port communication mfc wizard from the basic socket communication program.
Both the ports belong to a single server and the must run parallely.
The application I've made so far is able to connect to the first port.
In the second port connection, server is listening for connections, but the client is unable to connect.
http://www.easy-share.com/1907562869/Sock.rar
Please run the program once. You'll see that only first port is connecting properly, while the second one isn't.
Please provide a relevant solution.
modified on Monday, August 31, 2009 5:13 AM
|
|
|
|
|
Whether both port numbers of single server are same?
What is port number of the second port connection?
Величие не Бога может быть недооценена.
|
|
|
|
|
both the port numbers are different.
i have used 4000 and 5000. both the ports are free.
|
|
|
|
|
Please share your code, so as understand the problem
or
You just check the error you are getting.
Величие не Бога может быть недооценена.
|
|
|
|
|
You're using two socket objects to connect to two different ports or you're trying to use the same? Did the call to connect fail? Have you checked the return values (and called GetLastError() if applicable?)
Can you show us the relevant code?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I'm using only one pointer object but 2 different socket objects.
I tried using 2 pointers, but the second pointer is showing many errors.
main part of the errror is
CSockDlg(CWnd* pParent = NULL); // standard constructor
CSockDlg(CWnd2* pParent = NULL); // standard constructor
errors
c:\documents and settings\admin\desktop\sock\sockdlg.h(34) : error C2629: unexpected 'class CSockDlg ('
c:\documents and settings\admin\desktop\sock\sockdlg.h(34) : error C2238: unexpected token(s) preceding ';'
c:\documents and settings\admin\desktop\sock\sockdlg.h(35) : error C2629: unexpected 'class CSockDlg ('
c:\documents and settings\admin\desktop\sock\sockdlg.h(35) : error C2238: unexpected token(s) preceding ';'
|
|
|
|
|
raviteja2020 wrote: c:\documents and settings\admin\desktop\sock\sockdlg.h(34) : error C2629: unexpected 'class CSockDlg ('
Have you included the correct header file?
That aside, what does any of this have to do with not being able to establish a connection? You need to provide a relevant code snippet.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
if you writing Socket Programs in Win32 Code,
you might have to develop multithread application for creation of Socket Server.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi everybody.
I want to submit a web form. Source of html page:
<html>
<body>
<form action="i.php" method="post">
Name: <input type="text" name="fname" value="MyName" />
Age: <input type="text" name="age" value="17" />
<input type="submit" />
</form>
</body>
</html>
If I submit the form in the page above, I would get:
Welcome MyName!
You are 17 years old.
And this is my code:
CInternetSession session(L"MyAgent");
CHttpConnection* httpcon=session.GetHttpConnection(L"localhost");
CHttpFile* httpfile=httpcon->OpenRequest(CHttpConnection::HTTP_VERB_POST,L"i.php");
CString headers=L"Content-Type: application/x-www-form-urlencoded";
CString data=L"fname=MyName&age=17";
httpfile->SendRequest(headers,(LPVOID)(LPCTSTR)data,data.GetLength());
CString t=L"";
UINT len=100;
char buf[100];
while(len>0){
len=httpfile->Read(buf,100);
if(len>0)t.Append(CString(buf),len);
}
AfxMessageBox(t);
httpfile->Close();
httpcon->Close();
session.Close();
Unfortunately, form is not being submitted. What I'm doing wrong?
I'm trying to do this thing 3rd time now, I don't want to give up this time
Any help would be greatly appreciated.
modified on Thursday, August 27, 2009 6:28 PM
|
|
|
|
|
check your localhost port in the class CInternetSession.
it's my pleasure to make friend with you.
|
|
|
|
|
You probably need to set the Content-Length header.
If I were you, I'd download Fiddler[^] and use it to see what the difference is between the POST sent by the browser in response to that web form and the POST sent by your program.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|