|
I remember that a sample is called avicap. You may search it in MSDN.
|
|
|
|
|
I HAVE downloaded a important project file which has few
*.c and *.h files and other file as *.vcp(VCPROJ) do anyone
know what type of file is this and is it related to any MVStudio.
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Visual C++ writes and uses a number of files during the build process.
.VCP is the Workspace (project) information file, which is the Visual C++ equivalent of the 16-bit version .WSP file.
If you build your program outside the IDE, you may use a makefile to invoke the command-line tools. If you build your program within the IDE, the embedded Visual C++ project system uses the project (.vcp) files to store thr make information.
SkyWalker
-- modified at 17:48 Saturday 12th November, 2005
|
|
|
|
|
.vcproj is the extension used for Visual Studio 2002 and 2003 project files.
Software Zen: delete this;
|
|
|
|
|
Thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I HAVE downloaded a important project file which has few
*.c and *.h files and other file as *.vcp(VCPROJ) do anyone
know what type of file is this and is it related to any MVStudio.
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hi everybody ::- ). I got an issue with some ATL thingy I'm working on. I made an ATL DLL which I use in Visual Basic 6. To set or get a string property I use BSTR, since Visual Basic uses this type. A value from VB6 successfully reaches VC++ 6. But not the other way around. Here's the VC++ code.
BSTR test;
STDMETHODIMP_(HRESULT) CASDINIFile::get_ASDOperator(BSTR *pVal)<br />
{<br />
AFX_MANAGE_STATE(AfxGetStaticModuleState())<br />
<br />
pVal = &test;<br />
<br />
return NULL;<br />
}<br />
<br />
STDMETHODIMP_(HRESULT) CASDINIFile::put_ASDOperator(BSTR newVal)<br />
{<br />
AFX_MANAGE_STATE(AfxGetStaticModuleState())<br />
<br />
test = newVal;<br />
<br />
return NULL;<br />
}
The VB code isn't of relevance. I say myatlobj.ASDOperator = "bla bla" and then try to query the value (and I get nothing). Of course, the problem lies in this line probably:
pVal = &test;
So the function REQUIRES me to give pVal a BSTR *. So I give the address of &test but obviously, it ain't working since probably VB 6 wants a simple BSTR. If I try to change the BSTR * to BSTR I this error from VC++:
error MIDL2121 : [out] only parameter must not derive from a top-level [unique] or [ptr] pointer/array : [ Type 'wireBSTR' ( Parameter 'pVal' ) ]
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
In get_ASDOperator you are passed a pointer to a BSTR . If you assign a value to that pointer, you've only affected the local copy of the pointer, not the BSTR that the original argument pointed to. Also, you've said that this is an [out] parameter, which means that you need to set the value that is pointed to.
What you want to do is something like this:
*pVal = ::SysAllocString(L"Return this string");
CString return_value;
*pVal = return_value.AllocSysString();
Software Zen: delete this;
|
|
|
|
|
Hi Gary, thanks for answering. I'm not an expert in VC++ but wasn't it supposed to be SysAllocString? Also, isn't this a memory leak? Where do we Free that string? Anyway, for all of you that stumble or will stumble upon this problem, the answer is:
<br />
STDMETHODIMP CASDINIFile::get_Operator(BSTR *pVal)<br />
{<br />
AFX_MANAGE_STATE(AfxGetStaticModuleState()) <br />
CComBSTR sToReturn;<br />
sToReturn.Attach(<YourBSTRVariableHERE>);<br />
sToReturn.CopyTo(pVal);<br />
sToReturn.Detach();<br />
return S_OK;<br />
}
Or at least this is the method I used ::- D.
And probably something like this will also work: (though I didn't test it!)
<br />
STDMETHODIMP CASDINIFile::get_Operator(BSTR *pVal)<br />
{<br />
AFX_MANAGE_STATE(AfxGetStaticModuleState()) <br />
BSTR *sToReturn = (BSTR *)pVal;<br />
*sToReturn = <YourBSTRVariableHERE>;<br />
return S_OK;<br />
}
Have fun ::- ).
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas wrote: wasn't it supposed to be SysAllocString
The CString member that returns a BSTR is called AllocSysString , for some strange reason.
Axonn Echysttas wrote: isn't this a memory leak
The rule with BSTR 's is the producer allocates it, and the consumer SysFreeString 's it. In your case, it will be the caller's job to free the string.
Software Zen: delete this;
|
|
|
|
|
You're overlooking the fact that the caller is VB, and VB is too retarded to free it *laugh* ::- ). Anyway, the job's done, hooray. In the meantime I ran in another "doodle". Check the above message if you wish to help ::- ) - actually it's too late to run from me since you're already in my "Thanks to" list ::- >.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
It wouldn't surprise me to find that VB frees the string automatically when the corresponding value goes out of scope. VB is where BSTR 's got their start anyway; BSTR stands for B ASIC STR ing.
Software Zen: delete this;
|
|
|
|
|
Basic String. Hehe. I didn't know that. Hm anyway, it doesn't free it. I already stumbled upon it. My first method to pass the string to VB was to create a global CComBSTR object. And guess what?? After the VB function that contained the instance of the ATL object finished execution, boom, crash (in VC++...). So VC++ was alerting me of the memory leak. So then I placed a .Detach() command to the CComBSTR back in the destructor of the ATL and no more errors ::- D. SO no, VB does not do it... ::- ).
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
i want to write in my script and in text feild too by using unicode (in georgian).
what should i do?
i wrote it in script after compiling there were two errors thay said that visual c++ doesn't support unicode
Programistebo saqartvelosi sheertdit
|
|
|
|
|
Define _UNICODE in the header file.
Please search for more infomation of using unicode programming in MSDN.
|
|
|
|
|
thanks!
could you please tell me where can i find info about this or i want to find manual for Visual C++
Programistebo saqartvelosi sheertdit
|
|
|
|
|
Try using the MSDN[^] web site first.
Software Zen: delete this;
|
|
|
|
|
I created a Global hook by creating a DLL that listens for the WH_SHELL message . I get notifications for all top level window creations .
Now I have a method in my DLL that looks like
MYShellProc(code , wParam ,Lparam)
{
...
return CallNextHook(....)
}
void DoSomething()
{
CEvent myEvent l
..
..
event->Lock(15000);
}
It is during this wait that I DO NOT GET any SHELL notifications during the wait . Is it due to the fact that my main thread is blocked in the wait ? Are there any workarounds ?
-- modified at 4:08 Saturday 12th November, 2005
|
|
|
|
|
inGrid is a MSHFlexGrid object.
...
...
inGrid.Clear();
inGrid.SetCols( 0, 3); //This line sometimes cause Access Violation problem.
...
...
Do anyone ever had this problem or know how to solve it?
Here's the call stack when the problem happen
==================================
MSHFLXGD! 01a908d0()
MSHFLXGD! 01a79abb()
MSHFLXGD! 01a75b2f()
MSHFLXGD! 01a8fdc6()
MSHFLXGD! 01a72d31()
OLEAUT32! 779d7d5d()
OLEAUT32! 77a2310e()
MSHFLXGD! 01a95945()
MSHFLXGD! 01a7dd7c()
COleDispatchDriver::InvokeHelperV(long 5, unsigned short 4, unsigned short 0, void * 0x00000000, const unsigned char * 0x006a01dc parms, char * 0x0012f7e4) line 345 + 54 bytes
COleControlSite::InvokeHelperV(long 5, unsigned short 4, unsigned short 0, void * 0x00000000, const unsigned char * 0x006a01dc parms, char * 0x0012f7dc) line 976
CWnd::InvokeHelper(CWnd * const 0x016f2550 {CSelectionGrid hWnd=0x00320ce8}, long 5, unsigned short 4, unsigned short 0, void * 0x00000000) line 354
MSHFlexGrid::SetCols(long 0, long 3) line 56 + 30 bytes
-- modified at 0:46 Saturday 12th November, 2005
|
|
|
|
|
Hello All
I want to store a BINARY file content (size of the BINARY file can be from 4 to 30 MB) to SAFEARRAY. I am reading the file content in BYTE*. For storing the data to SAFEARRAY, I found the API SafeArrayPutElement. But using this I have to copy BYTE by BYTE. Is there any way to copy full data of type BYTE* or char* or CString to SAFEARRAY?
Currently I am using
for(nBufIndex=0; nBufIndex < nFileSize; nBufIndex++)<br />
{<br />
hr = SafeArrayPutElement(l_pSafeArray, &l_lSAIndex, &pBuffer[nBufIndex]);<br />
l_lSAindex++;<br />
}
Thanks for your time
Ravi
|
|
|
|
|
SAFEARRAY *psa;
psa = SafeArrayCreateVector( VT_UI1, 0, LengthInBytes );
unsigned char *pData = NULL;
SafeArrayAccessData( psa, (void**)&pData );
memcpy( pData, pMemData, LengthInBytes );
SafeArrayUnaccessData(psa);
SkyWalker
|
|
|
|
|
im creating a helper class to hide and show the following controls:
ControlBar
ReBar
ToolBar
DialogBar
StatusBar.
my problem is i dont know how to hide/show those items using a class. If you know some articles or links or you know how to do it, please reply to my post.
Thanks! Your help is deeply appreciated.
|
|
|
|
|
I have used the Dialogbar it also had problem
to Show/Hide ,
ControlBar is the base class of Dialogbar
hence i used a pointer to the MainWnd and
then use to Show/Hide by setting the thirdparameter
as TRUE/FALSE.
this->ShowControlBar((CControlBar*)&m_dlgbar,TRUE,0);
//this is a ptr to MainWnd
U can try this type of trick for your class
Its a good effort will be help full to many developers
do post me the copy of the class when u have done it
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Get handle of the item that you would like to show or hide. Then use the ShowWindow() function to proceed.
Rajesh R. Subramanian
Akruti Software,
Bombay, India.
|
|
|
|
|
Hello all, using the ADO _ConnectionPtr->Exexute() method, i can add new rows to my Access 2000 database, the problem is like this, assume theres a table called people, with fields per_id of type Autonumeric, and name of type Text(50), if i write my sql to add a new record like this:
INSERT INTO people VALUES(NULL, 'mike')
then i get a com exception saying that i cannot assign Null to a non Variant type variable. If i write it like:
INSERT INTO people VALUES(0, 'mike')
it works (once), but the database actually sets per_id to 0, instead of asigning an anuto-incremented value. So the question is:
what should i pass to an INSERT INTO statement when one of the fields is autoincrement?
Thanks!
|
|
|
|