|
The above answer is very much correct if you have an avi file etc already saved somewhere.
Maybe you want to show the live video from the webcam in IE.
For that, you could do the following: (VC6)
1- Create a new ATL/COM project using Appwizard.
2- Insert New ATL Object->Controls->Composite Control.
3- Now you have a dialog, on which you can place controls, write code behind it, etc.
Hope that helps.
this is this.
|
|
|
|
|
Hai khan++
Thanks a lot for your help
I will try it
JAYARAJ
|
|
|
|
|
Hi,
I want to make a call to IDispatch GetIDsofNames and IDispatch Invoke from one COM exe to another COM exe (in which the implementaion of these two methods is being done). The second COM exe is an automation wrapper. In doing so I want to pass an argument (BSTR) to IDispatch GetIDsOfNames and Invoke from the caller exe so that i can preserve my thread pool design. e.g I need to do the following
STDMETHOD (GetIDsOfNames)(REFIID riid, LPOLESTR* rgszNames, UINT cNames,LCID lcid,DISPID* rgdispid, BSTR sessionID );
STDMETHOD ( Invoke )( DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispparams, VARIANT* pVarResult, EXCEPINFO* pExcepinfo,
UINT* puArgErr, BSTR sessionID);
Can some body tell me the exact signature to be used in my IDL for GetIDsOf Name and Invoke.
|
|
|
|
|
IDisptach is a starndard COM interface.
Some quick thoughts -
1. You can inherit your own dispatch interface from IDispatch and implement this interface instead
2. Add a property "SessionID" to this new IDispatch dervide interface
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
hello guys,
I am having a VB6 COM FTP application that is being called by some VBScript. It works perfectly fine in Windows based ftp server. However, one of the client is trying to use it in IBM Mainframe box (don't know the version yet) but it doesn't work. connection to mainframe occurs ok however when trying to put the file to mainframe it doesn't work.
The vb6 code is as below: In an ideal windows ftp environment I call it as:
myFTP.PutRemoteFile("c:\test.txt", "", "/MyFTPFoder") and it works fine.
However, the client has some funny naming convension of their mainframe file system. eg RemoteFolder is as F1.Test.ASL.Mne.FTS (they call it dataset)etc.
my questions are:
Is it a valid naming convension for the mainframe eg F1.Test.ASL.Mne.FTS?? or it needs to be mapped to a physical drive?
Is there any reason the ftp shouldn't work in mainframe while working in windows?
Thx
Public Function PutRemoteFile(LocalFilename, RemoteFilename, RemoteFolder) As Boolean
On Error GoTo handler
Dim bRet As Boolean
PutRemoteFile = False
LocalFilename = Trim$(LocalFilename)
RemoteFilename = Trim$(RemoteFilename)
RemoteFolder = CStr(Trim(RemoteFolder))
''''set the directory as per user's input and check if there is no error. If error returns false.
If FtpSetCurrentDirectory(hConnection, RemoteFolder) = False Then
Err.Raise vbObjectError, TypeName(Me), "Directory doesn't exist in Remote folder : " & ExtendedError(Err.LastDllError)
PutRemoteFile = False
Exit Function
End If
'Is the local file set?
If LocalFilename = "" Then
Err.Raise vbObjectError, TypeName(Me), "LocalFilename is blank - it must refer to a valid local file"
End If
'Does the local file actually exist?
If (Not FS.FileExists(LocalFilename)) Then
Err.Raise vbObjectError, TypeName(Me), "LocalFilename '" & LocalFilename & "' does not exist or the user context does not have read-access"
End If
'Are we connected?
If (Not Me.FTPServerIsOpen) Then
Err.Raise vbObjectError, TypeName(Me), "Must call OpenFTPServer first"
End If
'If it ends in \ then we assume the caller wants to use the same filename as the RemoteFilename
RemoteFilename = Trim$(RemoteFilename)
'''If remote file name doesn't exist assuming it will be same as local!
If RemoteFilename = "" Then
RemoteFilename = FS.GetFileName(LocalFilename)
End If
'Some/most ftp servers prefer / so play it safe and convert all \ to /
RemoteFilename = Replace(RemoteFilename, "\", "/")
If (Right$(RemoteFilename, 1) = "/") Then
RemoteFilename = RemoteFilename & FS.GetFileName(RemoteFilename)
End If
'Put it on the server
bRet = FtpPutFile(hConnection, LocalFilename, RemoteFilename, dwType, 0)
'Could be problems with write-access on the server, or whatever
If bRet = False Then
Err.Raise vbObjectError, TypeName(Me), "PutRemoteFile failed : " & ExtendedError(Err.LastDllError)
End If
PutRemoteFile = True
Exit Function
handler:
DealWithError Err
End Function
|
|
|
|
|
Hi,
I have an MFC based Document-View-Application with a CHTMLView hosting a IWebBrowser-Control. Futhermore I implemented an Event Sink based on a CCmdTarget to listen to MouseMove-Events (HTMLDocumentEvent) within the Browser-Control. This works fine for websites not working with frames. When I work with frames I only get connected to the frame-document itself.
Any help is truly appreceated.
Juergen
|
|
|
|
|
I am new to COM. I am developing an application using COM. I got the error as: error LNK2001: unresolved external symbol _CLSID_WMRMKeys. What I know is that the com object is from a DLL, and I registered the DLL by running regsvr32 *.dll, and the registration is successful. Thanks for your help.
|
|
|
|
|
I presume you have included the header file for the dll in your application and everything looks fine until you link. I would recommend if you are new to com that you use the #import directive to access the dll's functionality (see MSDN) for more information.
The alternative would be to use include the yourdllsname_i_.c stub file in your project. Turning off precompiled headers on that file otherwise you'll get a weird "stdafx" not found error.
Using #import would be easier but ...
Regards
Ray
"Je Suis Mort De Rire"
Blogging @ Keratoconus Watch
|
|
|
|
|
Hi Forum!
this is Shatrughan Mishra. I am thankfull to
you all as many like me would have been for the articles posted by you on
codeproject.com.
I have been trying to add two addins to the MS word 2000 and XP. Both
are working fine independently. But, the problem is when I try to add
both of them the one is overridden by the other and both produce the
same result. I also would like to learn about the mystery of ".dot".
Please guide me and help me solve my problem. If you charge anything for
this, I would be glad to pay for it.
Thanx in advance!
Regards!
Shatrughan.
Shatrughan Mishra
|
|
|
|
|
Are the two add-ins using the same original code? I mean, did you create one project and made two copies, and changed the code in both the copies to create two add-ins?
If you did the above, then it will not work, as the GUID is the same for both. Then you should create new GUIDs using the GUIDGen.exe utility, and use them in at least one of the projects, so that they do not conflict.
And about the ".dot" stuff, sorry, I have never worked with that.
this is this.
|
|
|
|
|
When we create distribution list of contacts in Outlook, it displays small icon at the top right corner of header (address card view) . I need to add such icon to simple contacts in address card view. It's possible to do, plaxo (www.plaxo.com) does this, but I unable t find any docummented or non-docummented issues for it. Can you help me?
|
|
|
|
|
hi all
i had make drawing on the dilaogs. now i want that these drawing should be saved in bmp file or the jpeg file tell me how to do that or any other place such as picturebox or any other COM component where i can draw ans save as bmp file.
ddd
|
|
|
|
|
There is an application with hosted Internet Explorer (WebBrowser). I have a problem with customizing
IE preferences. They are to be customized only for an instance of Internet Explorer without affecting
global preferences stored at HKCU\Software\Microsoft\Internet Explorer.
1. I need to specify default page, colors, CSS styles and font size. I use
IDocHostUIHandler::GetOptionKeyPath to specify registry path with custom preferences:
STDMETHODIMP rbDHTMLBridge::GetOptionKeyPath(BSTR __RPC_FAR *pbstrKey, DWORD dw)
{
MessageBox(NULL,"GetOptionKeyPath", "GetOptionKeyPath", MB_OK);
static LPCWSTR lpwszKey = L"Software\\MyApp";
if ((*pbstrKey = (LPOLESTR)CoTaskMemAlloc((wcslen(lpwszKey) + 1) * sizeof(OLECHAR))) != NULL) {
wcscpy(*pbstrKey, lpwszKey);
} else {
return E_INVALIDARG;
}
return S_OK;
}
Function is called by IE and returns S_OK. But it does not affect hosted IE: it uses global
preferences.
Why it didn't work? May be I missed some initialization?
2. I need to remove footer and header of HTML pages printed using hosted IE. It can't be done
by GetOptionKeyPath (Internet Explorer uses global preferences for footer and header in any case).
It can be done by WebBrowser.ExecWB(OLECMDID_PRINT, ...) as described in
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q267240. I copied code from this article into
my application but it didn't work. Footer and header from original page were used on the printed page.
Why it didn't work?
May be the reason is what i have IE6.0 but the highest version of IE in APPLIES TO section of the article is 5.0?
Any help will be appreciated.
|
|
|
|
|
Hello,
I was wondering if it is possible to implement MDI in a MFC based ActiveX control. I was able to implement SDI (using a sample from MSDN), but I faced some difficulties when implementing MDI. Any help would be highly appreciated.
Thanks in advance,
Dennis.
|
|
|
|
|
Hi,
I want to pass the reference(test) of the interface (ITest) define inside the COM DLL (TestCom.dll) in my application function.Example
GetMerchItemType( TestComLib::ITest &test, int Temp)
However I am facing the following error.
error C2653: 'TestComLib' : is not a class or namespace name
error C2061: syntax error : identifier 'ITest'
Can you please help me resolve this error.
Thanks
|
|
|
|
|
Check the spelling.
If you haven't explicitly renamed the namespace it would look something like 'TESTCOMLib'.
--
Roger It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Hi everybody
I got some problems by using an application under Windows NT 4.0, this application uses OPC and it seems it's causing this kind of problem... it says RPC system not initialized... another weird thing is the request of the missing OCX of WinSock "mswinsck.ocx" that should come with the system (I took one on Win2K and registered by my own using REGSVR32... but I'm not sure it's a great idea...). If somebody know anything that may help please tell me!!!
Thanx
TK
|
|
|
|
|
Hi, friends
I tried to build a dll which support COM self-regist using Visual C++ 6.0. I used a API, named LoadTypeLib, to load the dll's typelib:
...
CComPtr<itypelib> pTypeLib;
HRESULT result = LoadTypeLib(module,&pTypeLib);
...
The variable "module" is the DLL's full path name. For example, I use "D:\\temp\\test\\test.dll". But, the return value "result" always is 0x80029c4a (TYPE_E_CANTLOADLIBRARY). If I use "D:\\temp\\test\\test.tlb" as the value of "module", this function should return 0x00000000(S_OK).
I have import "test.tlb" into the resource of test.dll. So I don't know how to resolve this problem.
Thanks a lot!
smalldemon
|
|
|
|
|
Hello smallbluedemon,
1. Make sure that you have set the resource type to be "TYPELIB" and have also set the resource ID to be 1.
2. Try out the following function to load your resource-embedded type library binary :
HRESULT MyLoadTypeLibrary(ITypeLib** ppITypeLibReceiver)
{
TCHAR szFileName[_MAX_PATH];
memset (szFileName, 0, sizeof(szFileName));
GetModuleFileName
(
(HMODULE)NULL,
(LPTSTR)szFileName,
(DWORD)sizeof(szFileName)
);
// Need to concatenate a \1 to the end of the filename
// because we are acquiring the type library which is
// embedded as the 1st resource of type TYPELIB.
strcat (szFileName, "\\1");
return LoadTypeLib((const OLECHAR FAR*)_bstr_t(szFileName), ppITypeLibReceiver);
}
Use it in your code this way :
int main(int argc, char* argv[])
{
CComPtr<ITypeLib> pTypeLib;
MyLoadTypeLibrary(&pTypeLib);
return 0;
}
Pls let me know how things go
Best Regards,
Bio.
|
|
|
|
|
Hello, Bio.
Thank you very much!
By your suggestion, I found my mistakes. In my resource header file "resource.h", I set following macro:
#define IDR_TYPELIB 199
But, I forgot to add this to file name. I add your statement:
........
GetModuleFileName(hInstance, ansiPath, MAX_PATH);
strcat(ansiPath,"\\199");
MultiByteToWideChar(CP_ACP, 0, ansiPath, strlen(ansiPath) + 1,module, MAX_PATH);
.......
Problem resolved !
Thank you again. Thank you very much!
Your sincerely
Remy (smallbluedemon)
|
|
|
|
|
Hello Remy,
That's great ! You are most welcome, Remy.
Best Regards,
Bio.
|
|
|
|
|
Hi Friends
I want to control the word doc at window form using C#
i am using a button to generate a table programmatically , when user insert a new table .
A aero should be shown to the previous table to the new one and all done programmatically on insertion of new table ..
Please let me know about the solution
|
|
|
|
|
I recently developed a .Net 2003 Windows Application that posts xml documents to a URL using XMLHTTP methods (required by vendor). I have not found any reference of XMLHTTP for the Net platform, but did find out that the methods are exposed through the MSXML library, so I added in my project a reference to the Interop msxml2 dll and used the methods. The application runs very well on my Visual Studio 2003 IDE, but when I moved the dll's to the server, it gives me the following exception:
System.Runtime.InteropServices.COMException (0x800C0008): The download of the specified resource has failed. at MSXML2.XMLHTTPClass.send(Object varBody) at ttHTTPWebclient.ttHttpWebClient.SendHttpRequest(String st
I don't know much about COM and have no idea what this error means. Could not find info about it on the net either, so I decided to try this forum.
Here is my code:
Public Function SendHttpRequest(ByVal strServiceURL As String, ByVal xmlMessage As String, Optional ByVal Mode As String = "msg") As String
Dim strResponse As String
Dim xmlhttp As New MSXML2.XMLHTTP
Dim xmlDocRQ As New MSXML2.DOMDocument
Dim xmlDocRS As New MSXML2.DOMDocument
Dim xmlLenght As Integer
Dim root As MSXML2.DOMNodeType
Try
'///////////////////////////////////////////////////////////////////
'// Createthe HHTP Post quote request //
'///////////////////////////////////////////////////////////////////
'Initialize Dom Variables
xmlLenght = xmlMessage.Length
xmlDocRQ.async = False
xmlDocRQ.loadXML(xmlMessage) 'Load xml Msg vendor request into a DOM
xmlhttp.open("post", strServiceURL, False, "ESPTest1", "4zz8ygh7mkka")
xmlhttp.setRequestHeader("Content-type", "text/xml; charset=utf-8")
xmlhttp.setRequestHeader("Content-length", xmlLenght)
'///////////////////////////////////////////////////////////////////
'// Send the Post request and get the response from the vendor //
'///////////////////////////////////////////////////////////////////
xmlhttp.send(xmlDocRQ)
xmlDocRS = xmlhttp.responseXML
strResponse = xmlDocRS.xml
'///////////////////////////////////////////////////////////////////
'// Return response to the calling method //
'///////////////////////////////////////////////////////////////////
Return strResponse
Catch ex As Exception
Dim strex As String
strex = ex.ToString()
Return strex
End Try
Any help will be greatly appreciated. I can not use normal POST messages because the authentication (userid/Password) can not be part of either the URL (query string) or the actual xml message being posted, per vendor requirement (owner of the page I am posting to) .
Regards,
Ivan
|
|
|
|
|
Hi friend
I want to complete knowledge of Remoting.
I have worked on .net .But i dont abt Remoting.
So Remoting related topic(online) which much helpfull for me.
Plz guide me how and easily i have learned,
On Intenet where are much Remoting related sample available.
Thanks
Friendsssss
Ashish
|
|
|
|
|
hello,
I am a newbie when working with COMs and dlls. I have written an application in VC++, and wanted to add one more functionality in the form of a function. Now this is additonal functionality is actually done by a VB team in the form of a .dll made in VB 6.
How can I import the function from that .dll to use in my application? Is there any tutorial available which addresses this issue?
Please let me know.
Thanks
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|