|
Ah, I assumed you had done that already! I knew about that "glitch" in VS.NET. Thanks for the notification though, I appreciate it!
--
Keep talking! You're the fool, I'm the preacher.
|
|
|
|
|
you knew it? hmmm.. ok, well some meet again with someother problem, so we'll keep "speaking" ([note]i wont say "talking!!" )about ATL ..!
bye dude,
Regards,
V
|
|
|
|
|
Vivekuniq wrote:
, so we'll keep "speaking" ([note]i wont say "talking!!" )
My signature isn't aimed at anyone.. it's a line from a song. But I think you figured that out.
Next time I won't assume so much.
--
Keep talking! I'm the preacher, you're the fool!
|
|
|
|
|
Hello everybody,
I'm working on an WTL application which has among its tasks to display video files (avi and mpeg). In fact, I don't know at all from where to start!! Can someone give me a little help or orientation? Thanks.
Madjid
-- modified at 6:04 Monday 26th September, 2005
|
|
|
|
|
Hello,
I am trying to write an OLEDB consumer in C++ and having problems with it. The database that i am trying to access has 3 binary columns. So i have to use more then one accessor to get the data and that is where i am facing problem. It works fine when there is one binary data column but fails if there are more than one binary column in a talbe. Following is the code
class COLLABORATION
{
public:
TCHAR m_ID[TCHAR_COL_LENGTH];
TCHAR m_PARENTID[TCHAR_COL_LENGTH];
ISequentialStream* m_DATA;
ULONG m_DATA_LENGTH;
ULONG m_DATA_STATUS;
ISequentialStream* m_TEMPDATA;
ULONG m_TEMPDATA_LENGTH;
ULONG m_TEMPDATA_STATUS;
BEGIN_ACCESSOR_MAP(COLLABORATION, 3)
BEGIN_ACCESSOR(0, true)
COLUMN_ENTRY(1, m_ID)
COLUMN_ENTRY(2, m_PARENTID)
END_ACCESSOR()
BEGIN_ACCESSOR(1, false)
BLOB_ENTRY_LENGTH_STATUS(1
, IID_ISequentialStream,
STGM_READ, m_DATA,
m_DATA_LENGTH, m_DATA_STATUS)
END_ACCESSOR()
BEGIN_ACCESSOR(2, false)
BLOB_ENTRY_LENGTH_STATUS(1
, IID_ISequentialStream,
STGM_READ, m_TEMPDATA,
m_TEMPDATA_LENGTH, m_TEMPDATA_STATUS)
END_ACCESSOR()
END_ACCESSOR_MAP()
};
void CMyDlg::Func()
{
CTable <CAccessor<COLLABORATION> > collabSourceTable;
hr = collabSourceTable.Open(seSource,_T("COLLABORATION"),&propset);
CString strName;
if ( hr == S_OK )
{
if (collabSourceTable.MoveFirst()==S_OK)
{
while(TRUE)
{
hr = collabSourceTable.GetData(1);
strName = collabSourceTable.m_NAME;
hr = collabSourceTable.MoveNext();
if ( hr != S_OK )
break;
}
}
}
}
Now i cant understand how to get binary data from the multiple accessors?. When i pass zero to the collabSourceTable.GetData(0);. It returns HR_OK. But when i pass 1 to collabSourceTable.GetData(1) to get the binary data. It gives error, hr = DB_E_UNSUPPORTEDCONVERSION. Can anyone help me with this. Thank you.
-- modified at 5:36 Monday 26th September, 2005
|
|
|
|
|
Hello to everybody!
Let us say, I want to create all the application that uses WTL by my own hands (avoiding using wizards). I want to create a modal dialog, and put some controls there. I write this code :
<br />
#include <atlbase.h><br />
#include <atlapp.h><br />
<br />
extern CAppModule _Module;<br />
<br />
#include <atlwin.h><br />
#include <atlctrls.h><br />
#include <atlframe.h><br />
<br />
#include "resource.h"<br />
<br />
CAppModule _Module;<br />
<br />
<br />
<br />
<br />
class CMyDialog: public CDialogImpl<CMyDialog> {<br />
public: <br />
enum {IDD=IDD_DIALOG1};<br />
<br />
BEGIN_MSG_MAP(CMyDialog)<br />
COMMAND_ID_HANDLER(IDOK,OnOk)<br />
COMMAND_ID_HANDLER(IDCANCEL,OnCancel)<br />
END_MSG_MAP()<br />
<br />
<br />
LRESULT OnOk(WORD,WORD,HWND,BOOL&) {<br />
EndDialog(0);<br />
return 0;<br />
}<br />
<br />
LRESULT OnCancel(WORD,WORD,HWND,BOOL&) {<br />
EndDialog(1);<br />
return 0;<br />
}<br />
};<br />
<br />
<br />
int WinMain (HINSTANCE hInst,HINSTANCE,LPSTR,int) {<br />
_Module.Init(NULL,hInst);<br />
<br />
CMyDialog diag;<br />
int res=diag.DoModal();<br />
<br />
_Module.Term(); <br />
return 0;<br />
}<br />
Than let's create a dialog with IDD=IDD_DIALOG1. I have VS6, so I go to the item in main menu Insert -> Resource... (QUESTION : IS THIS THE RIGHT WAY ?), then I choose Dialog etc. Then I add resource.h and test.rc (let it have that name) to my project. Compiling.... Ok. Running... ALL RIGHT. Now. I take a slider and put it on the dialog. Compile... OK. Running... Ooops. The variable res in the line int res=diag.DoModal() return -1. And of cource I cannot see anything on screen, application terminating.... If I put a button or combo on dialog, everything would be OK. I noticed, that if I put some other controls on dialog then I would have the same trouble ! What's wrong with this ? I suspect, that I do something wrong with resource adding..
|
|
|
|
|
how to copy a BSTR to char array? :-?
char sz[20];
BSTR *bstr;
[i tried the below code, but didn't work]
strcpy(sz,W2T(bstr));
Err:
D:\PROJ\CTI MFC FW\ATL53\AT53.cpp(16) : error C2065: '_lpw' : undeclared identifier
D:\PROJ\CTI MFC FW\ATL53\AT53.cpp(16) : error C2440: '=' : cannot convert from 'unsigned short ** ' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
D:\PROJ\CTI MFC FW\ATL53\AT53.cpp(16) : error C2065: '_convert' : undeclared identifier
Thanks
V
|
|
|
|
|
Insert USES_CONVERSION before using one of the conversion macros.
|
|
|
|
|
W2A means Wide to Ascii
W2T means Wide to TCHAR, and TCHAR is Wide or Ascii, depending on if _UNICODE is defined or not. You will want to use W2A.
Good music: In my rosary[^]
|
|
|
|
|
Hello All,
I am developing two different application in MFC. but i want to access same address space which is created by one. i want to create linklist created by one application and accessing by another.
I am beginner in COM & DOCM. if any one knows please help me.
Thanks in advance
Regards
Rajesh
|
|
|
|
|
rajesh_kapure wrote:
I am developing two different application in MFC. but i want to access same address space which is created by one. i want to create linklist created by one application and accessing by another. I am beginner in COM & DOCM. if any one knows please help me.
These are you options on Windows:
Windows Interprocess Communications[^]
|
|
|
|
|
Thanks, but i want to access same memory location from different application.
and for sharing same address space that artical contain only one solu'n 'File Mapping'.
Is any solu'n for accessing same address space.
waiting for reply.
Regards,
Rajesh
|
|
|
|
|
rajesh_kapure wrote:
Thanks, but i want to access same memory location from different application.
and for sharing same address space that artical contain only one solu'n 'File Mapping'.
Memory for Win32 programs is protected (in principle). You can define global variables that are accessible from more than one program. Don't remember how you do it (you need some sort of pragma) and it's very bad style anyway.
|
|
|
|
|
I implemented a ATL service in VC++ which notify me if any new file is created at certain path. But i want to know to the information about the file like it's name, creation time, size etc.
How can i do this.
please help me.
|
|
|
|
|
i'm able to add methods to an Interface that returns integer value, like i declared
[Add method]
method name : MathAdd
parameters : int x,int y,[out,retval]*int sum;
[/Add method]
and the implementaion,
STDMETHODIMP StATL::MathAdd(int x, int y, int *sum)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
*sum = x + y;
return S_OK;
}
and i'm using this in a VB application thru referncing.
Now, how do i make a method thats gonna return a char value,
i tried like ,
[Add Method]
Method Name : ReturnString
Parameters : char * inpString,[out,retval]char *outString
[Add Method]
STDMETHODIMP StATL::ReturnString(char *inpString, char *outString)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
strcpy(outString,inString);
return S_OK;
}
but i get the following errors, (see the following thread, it looks akward if i put it here)
plz note : this is my first attempt in ATL
thankx
Vdio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class atl::ccomobject<class="" cstatl=""> >::CreateInstance(void *,const struct _GUID &,void
** )'
[/stink] .
how to go
plz note : this is my first attempt in ATL
thankx
V
|
|
|
|
|
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1827) : error C2259: 'CComObject<class cstatl="">' : cannot instantiate abstract class due to following members:
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class atl::ccomobject<class="" cstatl=""> >::CreateInstance(void *,const struct _GUID &,void
** )'
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1827) : warning C4259: 'long __stdcall IStATL::ReturnString(unsigned char *,unsigned char *)' : pure virtual function was not defined
d:\proj\stratl\stratl.h(80) : see declaration of 'ReturnString'
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class atl::ccomobject<class="" cstatl=""> >::CreateInstance(void *,const struct _GUID &,void
** )'
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1827) : error C2259: 'CComObject<class cstatl="">' : cannot instantiate abstract class due to following members:
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class atl::ccomobject<class="" cstatl=""> >::CreateInstance(void *,const struct _GUID &,void
** )'
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1827) : warning C4259: 'long __stdcall IStATL::ReturnString(unsigned char *,unsigned char *)' : pure virtual function was not defined
d:\proj\stratl\stratl.h(80) : see declaration of 'ReturnString'
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class atl::ccomobject<class="" cstatl=""> >::CreateInstance(void *,const struct _GUID &,void
** )'
V
|
|
|
|
|
|
yeah.. i get u . thanks
V
|
|
|
|
|
did it work for you? how? because I tried it out using BSTR as the type of property to return but when I tried to put a string or even a character to the variable
STD....... (BSTR *pVal)
{
....
*pVal = "Hello";
}
error about conversion occurs for the above code snippet
|
|
|
|
|
hi
i m new to atl and want to learn any books or the help regarding the atl classes and their documentation.
ddd
|
|
|
|
|
Teach yourself ATL in 24 hours is a good book; quick and dirty "how to"
COM+ Programming. A Practical Guide Using Visual C++ and ATL is another great book.
Hit the programming fourms here as well, you'll find plenty of "How to's" and beginning guides for development.
:..::. Douglas H. Troy ::..
Fold with us|Development Blogging|viksoe.dk's site
|
|
|
|
|
I have an ATL windows service that exports a couple of com objects that implement connection points.
If I just use the exe as a com server the connection points work if I use it as a service I get permission denied when I declair a new instance of my object.
a programmer traped in a thugs body
|
|
|
|
|
The failure is in the Advise function.
I call query interface on the interface return from GetConnectionInterface() and I ret a permission denied.
a programmer traped in a thugs body
-- modified at 17:21 Tuesday 20th September, 2005
|
|
|
|
|
What happens if you allow the service access to the desktop?
Ctrl Panel\Administration\Services
find your service, right click Properties
Log On
check "Allow service to interact with the desktop"
-Warren.
|
|
|
|
|
I was using a user account to log the service on with, not with the service account. If I switch to the system account the connection points work but I don't know how to map to foreign share using the system account.
a programmer traped in a thugs body
|
|
|
|