not able to include dbt.h win32 programming - usb

I have written a win32 program for detecting USB port device insert and removal.
For this i have used dbt.h header file provided by system.
But still my program fails to link to that and hence my program dont compile.
I have Windows DDK installed on my system and i can find 4 diffrent dbt.h header files.
which one is correct one to connect and how to connect to it.
thanks in advance
Vinayaka Karjigi

You need to include the header file but you also need to link the dll that contains the actual code.

How are you including this in your project? It is possible that you haven't got a search path set for the directory that the file resides in.
As there are multiple versions. I would copy the one that I want into the project directory and include using the quote format for local files rather than the chevrons for system files.

Related

Cocoa Application on remote files?

I have created a small application that selects the files and renames spaces into underscores and few other symbols. It works fine when I tried with the files on my desktop but it fails to execute when i try with files on my remote server. The problem is it doesn't show any signs of error. In my application, once the files are renamed, I will get a notification on my app stating the number of files renamed. It does show that the file is renamed but I couldn't find the renamed files. Any suggestion as to why it happens or any fixes for this please.
I have created the application and exported as a Mac Executable Application.
Solved: NSFileManager recognises file paths in different formats so we need to change according to the default path format with which Mac recognises and update files. I changed accordingly and it works. Thanks for you help.

Parent directory headers using Arduino

I have a few headers and source files which I want to be common between two sketches (as they are communication interfaces) but I can't include them in my sketches: this very arguable system of tabs refuses to find them when I use relative paths.
Example:
Project
-interface.h
-interface.cpp
-sketch1
--sketch1.ino
-sketch2
--sketch2.ino
I would like to do:
#include "../interface.h"
Without making a library out of it and putting it elsewhere (so as not to have to move around files when they are handed out to somebody else).
Thank you for your help (I'm growing mad over here ),
Mister Mystère
P.S: Version is 1.0.5 on Windows
The bad news is you probably have to place interface.h/c in a library folder. The good news is that it is not that difficult. Simply create a folder named "interface" as a peer to other library folders and cut/paste interface.h/c into that folder.
Finally, after creating the new folder/lib you will need to completely exit Arduino's IDE and restart it, before you can select a new "interface" lib for your sketch.
Create symbolic links to all of the required files.
Linux
ln -s sourcefile targetfile
Windows
mklink targetfile sourcefile

header file not display in xcode project

I'am a newcomer to cocoa developement and i have not yet got used to.
When use eclipse for java development, we can see all the added jars source file if we attached the source files.
But in xcode, we add a framework such as "Cocoa.framework",there is only one Cocoa.h file we can see.
eg:
I clone the 'Sonora' source code from github for study.
there is one line
#import "SNRFileCopyManager.h"
exist in SNRFileImportOperation.h file
Both the SNRFileImportOperation.h and SNRFileCopyManager.h can be found in Sonora/Classes directory.
But, i can see the SNRFileImportOperation.h file in xcode project only and they get work fine together, Why this non third party header file not display in it's own project?
I know something about the dependency setting adn header search paths.
Any one give me a guidance or some references of the code management|organization?
Thanks a lot.
The file SNRFileCopyManager.h is found because it is in one of the include search paths. If you select a header file in Xcode and look at the info panel on the right side you can see that it doesn't actually belong to any target, they are shown more or less regardless. Though, building a framework you can select header files to be included into the framework when building. So, you can just pull in your header files into Xcode.

Variable that refers to the project directory in Qt Creator?

I'm working on a cross-platform Qt application and the paths are different on Mac OS X and Windows. Since the project is on an external hard-drive, the drive letter also occasionally changes on Windows.
For that reason, I would like to refer to the project directory using a variable, preferably a built-in one. In particular, is there such a variable usable in:
The .pro file?
The build settings (in the Projects tab)?
To complete, #Bill's answer, the way to refer to the source path in the Build Settings is to use %{sourceDir}.
%{buildDir} is also available.
Since I struggled a bit to find it, I'm adding it here.
In addition to %{sourceDir} and %{buildDir}, you could use %{CurrentDocument:Path}, %{CurrentDocument:FilePath} and %{CurrentProject:Path} to refer to specific files and folders in the project directory.
The built-in _PRO_FILE_PWD_ variable contains the path to the directory containing the project file in use. That variable may be useful for you.
There are problems with $$_PRO_FILE_PWD_ on windows, because it contains forward slash allways. You need to fix slash using shell_path.
$$shell_path($$_PRO_FILE_PWD_)

Build and Debug application outside the default package

If I try to build an application with the application class outside the default package, so the application file path is /app/AppClass.mxml instead of /AppClass.mxml (as would normally be the case), Flash builder cannot launch the application for debugging because it is looking for the SWF in debug/app/AppClass.swf and the SWF is being output to debug/AppClass.swf instead. Changing the output folder to debug/app makes it put the swf in debug/app, but then it puts the application configuration file "AppClass-app.xml" in /debug/app/app and then that can't be found.
Is there a way to change only the SWF output folder, or the location of the xml configuration file in the run-configuration?
You may use symbolic link to created swf file - http://en.wikipedia.org/wiki/Symbolic_link
for example for Windows :
cd project/path/bin-debug/package/path/
MKLINK ClassName.swf project/path/bin-debug/ClassName.swf
and it's work
or you can use symbolic link for folder:
cd project/path/bin-debug/package/
MKLINK path project/path/bin-debug/ /D
I think I remember this worked for me. But it was long time ago. And, yes, it is a known problem, I also recall Adobe people mentioning it as a limitation of FB.
In my Ant script, you'll need to do the adjustments to reflect your actual file names and directory structure. Also note that it will make it more cumbersome to debug it from FB. You'll need to use the debugging target in Ant, and then connect the debugger to the running application (so that some info, especially on the startup) will be lost. The only way you would be able to debug it, though I've never tried it, is with the commandline tools (I'm not sure of adl syntax for breakpoints / printing / stack frames, so idk how to do it.
Also, for the released application you will probably want to change the signing mechanism.