|
Use macro "CT2A()" or "CW2A()"
|
|
|
|
|
|
Firstly if you are using wide char (Unicode)then CString will be of Type CStringW by default and thus all us need to do is if u have :
CString str;
// do the following
CW2A(str); // this will give u const char*
else if its Multibyte charset project CString will be of type CStringA by default:
// u can directly cast it to char* as below:
CString str;
//do the following
(CHAR*)str.GetString();// this will give u Const char*
If you like this ans mark it and close the thread
Regards
Kushagra
|
|
|
|
|
Hi all,
I am new to opencv and I want to use it. But Before the application starts an error appears:
"The application was unable to start correctly (0x0150002).Click OK to close the application"
Please help me(I am using opencv2.0 and running windows vista)
Thanks.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
dSolariuM wrote: But Before the application starts...
What application?
"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
|
|
|
|
|
Hi, thanks for quick reply...
I mean my application (.exe) file. after i press F5 button to debug the error appears.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
Have you narrowed the problem down to OpenCV? In other words, what happens if you cerate a new project that does not use OpenCV?
"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
|
|
|
|
|
I have the problem with opencv only... I have included all the files and libraries...
Then I write a simple code that uses opencv libraries... Then I debug the app and the error appears... Before even clicking on the button that contains the code...
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
Are you implicitly or explicitly linking with their libraries? Have any global OpenCV-related objects been declared?
"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
|
|
|
|
|
I have global declarations of opencv classes and I am using "additional dependencies" section in Linker options.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
dSolariuM wrote: I have global declarations of opencv classes...
Classes or objects? Global objects will be instantiated before your "main" function gets called. That may be where the error is happening.
"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
|
|
|
|
|
Basic question. I assume you managed to build the OpenCV libraries and/or DLLs successfully? Also, do you know about the OpenCV support group on Yahoo Groups? You may have better luck there since it's a specialized support group.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
i have the same problem...did you find any solution?
/David
|
|
|
|
|
I am facing same problem.. Has any body found solution for same
|
|
|
|
|
hi, maybe already is late, but like aditional information, i got the same problem and i solved, a had put cv210d.lib; cvauxd.lib; etc. in the entry of Link in properties window, I erased the letter 'd' cv210.lib; cvaux.lib; etc. and the message "The application was unable to start correctly (0x0150002)" no appeared other time.
Regards.
|
|
|
|
|
Hello
Is there anyway to force the background of a dialog to be visible? For some reason all my dialogs have lost their bgs although I can't find a call within my code that uses WM_ERASEBKGND.
In order to see whether if was the dlgs themselves, or something else I constructed a basic one. It was created using all the default settings in the VS resource editor. The problem still occurs. I can attach the code for this basic dlg but the post will be quite long.
If there is no way to force the background to be visible, does anyone have any idea of what might have caused this? The buttons and other items in the dlgs are visible, just not the background or title-bar.
Many thanks in advance for help offered.
|
|
|
|
|
Will-O wrote: For some reason all my dialogs have lost their bgs...
So what is visible?
"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
|
|
|
|
|
Visible:
- buttons
- text in text-boxes (editable and static)
Missing:
- dialog background
- text-box background
- static-text
- title bar
Other:
- space where dialog background would be renders whatever is immediately below it
- space where text-box background would be renders desktop background
Hope that clarifies enough to assist
|
|
|
|
|
Will-O wrote: Hope that clarifies enough to assist
I'm clueless. It almost sounds intentional rather than accidental. What version of VS are you using?
"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
|
|
|
|
|
Did you set the property "transparent" to true?
|
|
|
|
|
What is the border property of your dialog box?
If it is None, change it to Dialog Frame.
|
|
|
|
|
I would also ask:
Does (eg) notepad show this problem too, if you use the help | about box?
If other programs are fine, then it's something you did. Make a copy of your project, and start ripping out whole sections until you find the "clever" thing you did at 2am while drinking too much beer last night...
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi All,
I really need help on working with USB. I cant find the answer anywhere
and I am starting to get really frustrated.
My problem is that I am trying to get a handler for a USB device so
that I can read/write to it. I was already able to compile my project using
Visual Basic 2008.
I followed these instructions to get Visual Studio 2008 to compile using winUSB libraries.:
1. Get Windows DDK.
2. Copy the following header files from DDK directory to your project
POPSHACK.H
PSHPACK1.H
SETUPAPI.H
usb100.h
usb200.h
usb.h
winusb.h
winusbio.h
3. Get Visual Basic to use those header files and pertinent libraries by:
1. Project > YOURAPP Properties --> C/C++ > General > Additional Include Directories : PROJECT_DIRECTORY
2. Linker > General > Additional Library Directories : WINDDK_DIRECTORY\lib\wxp\i386
So now everything compiles perfectly. But when I run my code, setupapi is not returning me the Interface Data.
I know the device is physically plugged in.
I know the GUID ID is valid because is written in the INF File which installs winUSB.
I verified that Windows Registry knows the device is there, and also verified the GUID is the same.
I verified Device manager sees the device with WinUSB driver and it is not showing any problems.
This is the code I am using. I took it from the How to Use WinUSB document
written by microsoft. I marked where the Interface is still empty.
<br />
BOOL CUSBDevice::GetDevicePath(LPGUID InterfaceGuid, PCHAR DevicePath, size_t BufLen)<br />
{<br />
BOOL bResult = FALSE;<br />
HDEVINFO deviceInfoSet;<br />
SP_DEVINFO_DATA deviceInfoData;<br />
SP_DEVICE_INTERFACE_DATA deviceInterfaceData;<br />
PSP_DEVICE_INTERFACE_DETAIL_DATA detailData = NULL;<br />
ULONG length;<br />
ULONG requiredLength=0;<br />
HRESULT hr;<br />
<br />
deviceInfoSet = SetupDiGetClassDevs(InterfaceGuid,
NULL, NULL,<br />
DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);<br />
if (deviceInfoSet == INVALID_HANDLE_VALUE){<br />
return bResult;<br />
}<br />
<br />
deviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);<br />
<br />
bResult = SetupDiEnumDeviceInfo(deviceInfoSet, <br />
NULL, InterfaceGuid, 0, &deviceInterfaceData);
<br />
<br />
if (bResult == FALSE){
DWORD tError;<br />
tError = GetLastError();
<br />
<br />
return FALSE;<br />
}<br />
<br />
SetupDiGetDeviceInterfaceDetail(deviceInfoSet,<br />
&deviceInterfaceData,<br />
NULL, 0,<br />
&requiredLength,<br />
NULL);<br />
<br />
detailData = (PSP_DEVICE_INTERFACE_DETAIL_DATA)<br />
LocalAlloc(LMEM_FIXED, requiredLength);<br />
<br />
if(NULL == detailData)<br />
{<br />
SetupDiDestroyDeviceInfoList(deviceInfoSet);<br />
return FALSE;<br />
}<br />
<br />
....
<br />
<br />
<br />
Thank you everyone, I really appreciate all the help i can get.
Dan
USB.... ITS EAAASY! Riiiiiiight....
|
|
|
|
|
dcabrera1983 wrote: My problem is that I am trying to get a handler for a USB device so
that I can read/write to it.
Use CreateFile() to get the handle. You can then use ReadFile() and WriteFile() with that handle.
"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
|
|
|
|
|
Hi, Thanks for your responese but could you elaborate a little bit more?
The device I am trying to connect is my own.. and I have read that to be able to do that
it needs to be a generic device, like a COM1 port or a HD device.. how do I open it as a file
or what would the file name and location be?
Thanks!
|
|
|
|