|
Hi friend,
it's urgent
I am using some DLL file (LpiCom_6_0.LPOrderPart.dll) in asp file for bulk payment charging (its support by LinkPoint). Its work fine but after some days its not work means registration failed. Again when we registered.it's work fine. What can be problem. If you have any idea then please help me i am facing from six month.
Thanks
Sujit
|
|
|
|
|
Sujit Gupta wrote: it's urgent
Just because you say "It's urgnet", no one will leave their own work and find solution for you
Sujit Gupta wrote: I am using some DLL file (LpiCom_6_0.LPOrderPart.dll) in asp file for bulk payment charging (its support by LinkPoint). Its work fine but after some days its not work means registration failed. Again when we registered.it's work fine. What can be problem. If you have any idea then please help me i am facing from six month.
There could be many reasons why it's not working. But from the details you have mentioned, it seems the problem is due to your DLL getting unregistered somehow.
I believe your DLL resides on one of your servers, I would check if there any script or activity happening on your server that is unregistering it periodically and doesn't register it again. I could be wrong here, but do check.
Sujit Gupta wrote: What can be problem. If you have any idea then please help me i am facing from six month.
Did you check with LinkPoint support?
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
hi,
i'm trying to get the source html code from web page.
IOleCommandTarget *iole;
IWebBrowser2 *iex;
CoCreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_SERVER, IID_IWebBrowser2, (LPVOID*)&iex);
hr = iex ->QueryInterface(IID_IOleCommandTarget, (void**)&iole);
if(SUCCEEDED(hr))
hr = iole ->Exec(&CGID_MSHTML, IDM_VIEWSOURCE, 0, 0, 0);
that doesn't works.
could you tell me what's wrong here?
are there other ways to get html source code without using MFC?
thanks for help.
|
|
|
|
|
sashka wrote: IOleCommandTarget *iole;
IWebBrowser2 *iex;
CoCreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_SERVER, IID_IWebBrowser2, (LPVOID*)&iex);
hr = iex ->QueryInterface(IID_IOleCommandTarget, (void**)&iole);
if(SUCCEEDED(hr))
hr = iole ->Exec(&CGID_MSHTML, IDM_VIEWSOURCE, 0, 0, 0);
What doesn't work here
. Query interface or
. hr = iole ->Exec(&CGID_MSHTML, IDM_VIEWSOURCE, 0, 0, 0);
what is the value of HRESULT after calling
hr = iole ->Exec(&CGID_MSHTML, IDM_VIEWSOURCE, 0, 0, 0);
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
method Exec() doesn't works.
it returns E_UNKNOWNGROUP.
i included mshtmhst.h, mshtmcid.h, mshtml.h.
in mshtmhst.h CGID_MSHTML defined in this way:
EXTERN_C const GUID CGID_MSHTML;
#define CMDSETID_Forms3 CGID_MSHTML
CMDSETID_Forms3 defined in mshtml.h:
EXTERN_C const GUID CMDSETID_Forms3
i am not very familiar with COM, but i have read that
every COM object must be registered in system through
it's unique GUID. so i tried to use macro
DEFINE_GUID(CGID_MSHTML, XXX),
XXX - GUID for CGID_MSHTML command group (found with google).
that doesn't worked.
|
|
|
|
|
Sorry for replying late. Is your problem resolved?
Can you point me to header/idl where E_UNKNOWNGROUP is defined?
sashka wrote: i am not very familiar with COM, but i have read that
every COM object must be registered in system through
it's unique GUID. so i tried to use macro
DEFINE_GUID(CGID_MSHTML, XXX),
XXX - GUID for CGID_MSHTML command group (found with google).
that doesn't worked.
You are suppose to register COM servers and coclass only for the components you develop. All other COM servers, be it Out of process server(EXE) or Inprocess servers(DLLs), are suppose to be registered in a predefined way. For Inproc servers, we usually use Regsvr32.exe to register the DLL (See DllRegisterServer function that is exported by any COM inproc server. This function is called.)
I believe reading some basics about COM before going ahead, will help design your component/application in a better way.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
sorry for replying late.
last time i gave you an incorrect description of my error, sorry for that too.
when the Exec() method fails it returns not E_UNKNOWNGROUP, but OLECMDERR_E_UNKNOWNGROUP,
it defined in docobj.h.
my goal was to retrieve a source html code from browser.
i have found another way to do it:
...
HRESULT hr;
IWebBrowser2 *iex;
OLECHAR *path = L"h://1.html";
IDispatch *iDisp;
IPersistFile *persistFile;
...
hr = iex ->get_Document(&iDisp);
if(SUCCEEDED(hr)){
hr = iDisp->QueryInterface( IID_IPersistFile, (void**)&persistFile);
if(SUCCEEDED(hr))
hr = persistFile ->Save(path, 1);
}
it works.
but i got a new problem - can't change the page, using Navigate() method:
...
hr = iex ->Navigate( L"http:\\www.bash.org", 0, 0, 0, 0);
the value of hr is -2147023116;
if you have some free time, please look whats wrong wiht that.
great thanks for help.
|
|
|
|
|
Good to know it you found a workaround for that. I might look at your original problem if my spare time.
Member 4718531 wrote: hr = iex ->Navigate( L"http:\\www.bash.org", 0, 0, 0, 0);
the value of hr is -2147023116;
I think iex ->Navigate( L"http:\\www.bash.org", 0, 0, 0, 0); should be iex ->Navigate( L"http:\\\\www.bash.org", 0, 0, 0, 0);
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Why we should not modify the existing interface which is released?
I am new please explain.
|
|
|
|
|
Avoiding crashes of existing clients may be a good reason?
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
modified on Friday, February 29, 2008 8:48 AM
|
|
|
|
|
|
Current clients of the your COM component rely on its interface as it stands. If you change the interface, i.e. the (binary) contract between the COM server and its clients, then you probably break the client themselves.
Interfaces must be immutable is one of the fundamental principles of COM .
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
|
|
|
|
|
hi all
I am working with an application in which i required to send fax periodically . For that i used windows service. If i started the service for first time the pdf document was sent successfully thru fax( i used faxcom.dll for this purpose). But second time on words it is not at all sending the fax. The application was executed and stopped at faxserv.Send() method.I was given timer delay 2 minutes in service to execute code to send fax. I just restarted my system then the system was showing an error like ' The adobe reader was encounterd a problem ' . After i checked the application(service) it was working properly. (it seems the system it self rectified the error in adobe)
But why the adobe was encoutered the problem (i can say that the problem for adobe is with my service only).
plz let me share any information in this regard .
Thanks in advance
Pinky
|
|
|
|
|
Hi there
I'm desperately searching for example code helping me to write a Rose Add-in in Vc++. There are couple of VB6 examples out there, but none in C++. I have knowledge in COM, and there is a TLB of Rational Rose available, but I'm stuck.
HELP !!!
|
|
|
|
|
I have a thread function which is something like this.
1)
Extract the pointer value which comes as part of the thread function call.
2)
Initialize the thread with ::CoInitializeEx(0,COINIT_MULTITHREADED) so that it enters the MTA of the process.
3)
Use the pointer extracted above in Step 2 to make a COM call.
The actual COM call (step 3) is made after the thread is initialized for using COM (step 2).
Is this fine? Should I also change my thread function such step 2 preceeds step 1.
Thanks
Rajdeep
|
|
|
|
|
The pointer you are passing needs to be marshaled because the coclass it belongs to is created within other appartment (unless your object is created withing MTA)
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi,
I have the the following body of code:
STDMETHODIMP_(ULONG) CoCarClassFactory::Release()<br />
{<br />
if(--m_refCount == 0)<br />
{<br />
delete this;<br />
return 0;<br />
}<br />
<br />
return m_refCount;<br />
}
My question is about the return 0; statement after the delete this; line. How can the function still return after deleting the object that contains itself?
TIA!
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
DenClancy wrote: My question is about the return 0; statement after the delete this; line. How can the function still return after deleting the object that contains itself?
just check this out, try it on any compiler :-
class ABC
{
public:
void MyFunc() { cout<<"hello atl";}
};
void main()
{
ABC *c= NULL;
c->MyFunc();
}
are you wondering it will work or not.. but it will work.. try it!
"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/codeProject$$>
|
|
|
|
|
|
In addition to the previous posts. The reason why this works is that it is ok to execute code after the class object is deleted only if you do not try to use any non static class variables.
John
|
|
|
|
|
Hi all,
I am working on an application that is written in Java. It's basically a middleware server. The client is a Java application. However, there's a need to develop an Excel client. I have been provided with an addin that has certain functions that the VBA can call. The other side of the COM DLL is made of c++ programs that use JNI to pass data to Java and receive results. I have successfully created new functions to work on this.
When I started working on this I created a '|' delimited string to pass data from Excel to COM to Java and vice versa. The strings looked like this:
|Property1=Value1|Property2=Vaue2|........|PropertN=ValueN|
In the early stages these functions that I had created were simple atomic functions i.e. take in one string spit out resultant string. Now, however I need to be able to send arrays of such strings and also receive results in the form of arrays of strings.
I used CComSafeArray to do so.
Here's the code of what I did
STDMETHODIMP CAddin::MyClass_LoadVals(VARIANT ValIds, VARIANT* outVals)<br />
{<br />
<br />
USES_CONVERSION;<br />
std::list<std::string> result;<br />
std::list<std::string> inpArr;<br />
<br />
CComVariant var;<br />
<br />
CComSafeArray<bstr> parr;<br />
CComBSTR* bstrs;<br />
var.Attach(&valIds);<br />
parr.Attach(var.parray);<br />
<br />
int dim = parr.m_psa->cDims;<br />
if (parr.m_psa->cDims != 1)<br />
return S_FALSE;<br />
<br />
if(parr.m_psa->rgsabound->cElements > 1)<br />
{<br />
SafeArrayAccessData(parr,reinterpret_cast<void **="">(&bstrs));<br />
for (int i=0;i < parr.m_psa->rgsabound->cElements;i++)<br />
{<br />
std::string tmp;<br />
tmp = W2CA(bstrs[i]);<br />
inpArr.push_back(tmp);<br />
}<br />
}<br />
SafeArrayUnaccessData(parr.m_psa);<br />
<br />
VariantInit(outVals);<br />
<br />
if(JavaInterface::JavaInterface_LoadVals(inpArr,result)){<br />
outVals->vt=VT_ARRAY|VT_BSTR;<br />
createStringArrayVariant(outVals,result);<br />
return S_OK;<br />
}else{<br />
getCalypsoError();<br />
}<br />
<br />
return S_OK;<br />
}</void></bstr></std::string></std::string>
Code for createStringArrayVariant(VARIANT,std::list<std::string> :-
<br />
bool createStringArrayVariant(VARIANT* to, std::list<std::string>& from)<br />
{<br />
VariantInit(to);<br />
SAFEARRAYBOUND bound = {from.size(), 0};<br />
SAFEARRAY* array = ::SafeArrayCreate(VT_VARIANT, 1, &bound);<br />
<br />
long index = 0;<br />
VARIANT v; VariantInit(&v);<br />
for(std::list<std::string>::iterator i = from.begin(); i != from.end(); i++)<br />
{<br />
convertStringToVariant(&v, *i);<br />
::SafeArrayPutElement(array, &index, (void*)&v); ++index;<br />
}<br />
to->vt = VT_VARIANT | VT_ARRAY;<br />
to->parray = array;<br />
return true;<br />
}</std::string></std::string>
Please bear in mind that createStringArrayVariant(...) function was provided to me with the product that I am working on.
The resultant output is correctly passed to Excel. I load it as a variant array and try and do further processing. However, the problem is when the output is loaded, Excel starts crashing while doing simple things like updating values in the cells or running a simple loop. These parts of VBA code work fine in isolation i.e. without loading that array of values. Sometimes when Excel crashes, it just simply disappears without so much as an error report. My logs for the addin and the logs for Java, none of them indcate anything. Is the array too big or is this sort of programming not advisable for linking VBA and C++. I really need this to work. Any help would really be appreciated.
Please bear in mind that I have little experience with C++ and almost no exprience with Visual C++, prior to working on this project. Whatever I have learnt is from the existing code or Google, so I could be quite wrong with my code here.
I'd appreciate any leads in this matter.
Thanks for your help
Sukant Saddi
|
|
|
|
|
Hi Sukant,
Looking at your code, I would say that createStringArrayVariant should change a little.
Create your safe array as ::SafeArrayCreate(VT_BSTR, 1, &bound); .
I am saying this because your MyClass_LoadVals seems to expect that. Also, it is much easier to use:
CComBSTR str = parr.GetAt(index);
than your call to SafeArrayAccessData
Anyway, my guess is your data has been destroyed. CComVariant var; is not really necessary, use parr.Attach(ValIds.parray);
You should detach it as well.
God bless,
Ernest Laurentin
|
|
|
|
|
Hi all,
I wrote a DLL in C#, and exposed some functions to COM interop by following these guidelines:
-declare a custom constructor
-declare the functions to be exposed as public.
-declare an interface that the class implements.
-created a type library (.tlb) using regasm.
Now the DLL functions can be viewed and accessed from an unmanaged language such as VB6 (tested it and it works).
The problem is that another C++ developer wants to use this DLL on another machine to create an application that would be distributed to clients.
What should steps should be done so the developer could successfully use this DLL in his code as well as the end users who will deploy and use the application?
Thank you for your help.
|
|
|
|
|
|
Hi
I’m facing one major issues mentioned below in my HostEmulatorClient application which is using "Attachmate EXTRA! X-treme 9.0" COM component.
- I created a windows form to connect with ORBIT system using EXTRA component. It is
working fine. I can open & view PTs with Phase status as “Await”. Now I have converted this
form into a window service as being a project requirement but my window service is not able to
connect with ORBIT system using the EXTRA component. My Window Service is updating a local log
file. Even in this log file there is no error/exception logged. I’m not able to trace the issue
here.
From code level I do not see any problem. These problems may be because of some missed configuration which I’m not aware about. Below is the code where I try to connect
with ORBIT system.
public bool Open()
{
try
{
EXTRA._System sys = new EXTRA.ExtraSystemClass();
EXTRA.Sessions sss = new EXTRA.ExtraSessionsClass();
EXTRA._Session ses;
EXTRA.Screen scr;
string str = sys.DefaultFilePath;
LogHelper.WriteLog("Path : " + str + "\\" + _AccessDetail.EmulatorFileName + ".EDP", LoggingCategory.AllLoggingMessgesLog);
//LOG IS GENERATED ONLY TILL THIS LEVEL. THERE IS NO LOG FOR LATER LOG STATEMENTS, LIKE LOG FOR EXCEPTION OCCURRED ETC
ses = (EXTRA.ExtraSession)sss.Open(str + "\\" + _AccessDetail.EmulatorFileName + ".EDP");
scr = (EXTRA.ExtraScreen)ses.Screen;
LogHelper.WriteLog("Session instance created ", LoggingCategory.AllLoggingMessgesLog);
return true;
}
catch (Exception ex)
{
LogHelper.WriteLog("Exception occured : " + ex.ToString(), LoggingCategory.AllLoggingMessgesLog);
throw ex;
}
}
Please if anyone around there has faced such issue & has got the solution or at least the cause for
this issue please share it.
Thanks
Kamal Chauhan
|
|
|
|
|