|
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!
|
|
|
|
|
dcabrera1983 wrote: it needs to be a generic device, like a COM1 port...
Have you tried:
CreateFile("COM1", ...);
"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 ,
I am using MS Access Database . Which has GUID as its one of the column. I have to fetch the data from this database using supplied GUID's . I have written the query like this
SELECT * FROM Images WHERE GUID = 'First GUID" OR 'Second' OR .. ..OR .. OR
This query can be long to N numbers of GUIDs passed. This query is working fine. But I have the doubt whether this query will fail at certain point due some buffer or limitation on query lenght. Is there any limitation on Query Length. Is there any other solution to make this query compact ??
Thanks in Advance
|
|
|
|
|
Found this site[^], look towards the bottom, hopefully it helps.
|
|
|
|
|
Hi,
I have a dialog with some edit controls and a property sheet with three pages. When we take the dialog the focus is on one of the controls in dialogf outside the property sheet. when i switch the focus using tab key, the focus first goes to the controls inside the sheet and at last comes to the tab of the sheet. but i want the order such that it should first go the tab before going to the controls inside that. Please tell me how i can do that.
|
|
|
|
|
If you are using resource editor, you can set the tab order there. It is available in "Layout" menu in VC6 and "Format" menu VC9. Shortcut key is Ctrl + D (in VC6 keyboard shortcut map). Then you can see the tab order indication for all controls. You can click on each controls to sequence.
If you are creating the controls dynamically, the creation order sets the tab order. You can change it by using SetWindowPos().
|
|
|
|
|
I want to be able to #define CSHARP if the dll detects a c# app, and not define it if its c++
if there is another way of doing it I would be open to that as well... I just cannot afford the time it takes to change this each time i build it with a different application
#define CSHARP
#ifdef CSHARP
typedef void (__stdcall *callBack)(unsigned char* buffer, int size);
#else
typedef void ( *callBack)(unsigned char* buffer, int size);
#endif
|
|
|
|
|
Greg Mort wrote: Using a C++ dll in C++ project and a C# project... C# requires __stdcall c++ does not... is there a way the dll can determine who is using him?
Do you build two versions of the same DLL ? Really?
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
[My articles]
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">CPallini wrote:</div>Do you build two versions of the same DLL? Really?</blockquote>
yes
C#, C++ <- windows and XP
|
|
|
|
|
I don't get you: C++ can call __stdcall functions.
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
[My articles]
|
|
|
|
|
CPallini wrote: I don't get you: C++ can call __stdcall functions.
agreed, however in this instance that is not going to be possible
therefore, I am asking if there is a way to detect who is using the dll, or another way
|
|
|
|
|
Greg Mort wrote: agreed, however in this instance that is not going to be possible
Why?
Greg Mort wrote: therefore, I am asking if there is a way to detect who is using the dll, or another way
Of course there is no way to determine, at compile time, the kind of programming language used to build the application the DLL will be linked to.
I believe I keep missing the point: if you really (I strongly doubt about...) need to maintain two different configurations of the DLL , cannot you just define these configurations in Visual Studio ?
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
[My articles]
|
|
|
|
|
yup def. missing the point... there are not two configurations, nor is this a sole thing to do with visual studio
read the thread below, it should make sense
like the other guy said, which is what i presumed the answer has always been, there is no true way to detect who is using a dll at compile because the code is already compiled, and nos not who is using it, its just a file, that is interpreted by another program...
one way to do this is to just make two separate functions, that then in turn use the same function inside of that dll
and the program must just call the appropriate function
|
|
|
|
|
I read that and the callback argument doesn't convince me. Could you provide a sample?
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
[My articles]
|
|
|
|
|
i dont think i understand what you are asking?
|
|
|
|
|
I believe the C++ application can use __stdcall (hence the same DLL for both C++ and C# applications, no need to detect whatever). You said it's not possible due to use of callbacks. Such an argument make no sense to me.
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
[My articles]
|
|
|
|
|
Why don't you simply make the function a stdcall function ? This is perfectly valid as long as it is defined as a stdcall function in your C++ application also.
This way, you don't need two versions of your dll.
|
|
|
|
|
Cedric Moonen wrote: Why don't you simply make the function a stdcall function ? This is perfectly valid as long as it is defined as a stdcall function in your C++ application also.
This way, you don't need two versions of your dll.
its not working with a callback
so this is why i am asking if there is a way to determine who is using the dll
|
|
|
|
|
What do you mean ? You need to pass this function to a third party (for instance the win32 API) ?
Could you give a bit more information about what you are trying to do ? It feels like you are doing something wrong here...
|
|
|
|