|
I want to open a pipe to the usb port and write some data. Can someone point me in the right direction?
Thanks,
Jill
|
|
|
|
|
I don't have a big experience with USB but I'm using a USB device and for this one, they provided a device driver that is used to communicate with the device. I can send control codes to this driver using the DeviceIoControl function. These control codes where also provided by the manufacturer of the USB device.
So every action (open a pipe, write data on this pipe, read data, ...) is performed via this function. I open the device with the CreateFile function.
Hope this helps...
|
|
|
|
|
I have source code for a program that I want to run on several PC's. I only have one PC with Visual studio so cant just re-compile the code on all the PC's.
I have tried just copying the .exe file generated by visual studio to all the PC's but the program does not seem to work properly. I am told this is because the .exe is dependant on a few .dll files.
I need to know how to package the .exe and the .dll files together to be installed on several PC's.
I think in Visaul Basic I could use the Package and Deployment Wizard, is there an equivalent to this in Visual C++?
I have not been able to find anything helpfull on the internet, so if anyone has any suggestions, please let me know.
Cheers
|
|
|
|
|
Gee, it's kind of hard to know what your program needs, if you're not going to tell us what it uses.
There is a program called 'Depends' ( from memory ) in the stuff that comes with VS, it might tell you waht you need. If you use MFC, you need the MFC dll, if you use C in your program, you'll need MSVCRT, etc.
I assume it's a release build ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Sorry Christian, I didnt write the code so I dont know what it uses. like I said, I am vey much a beginner and the code is way over my head.
Thanks for the help though. Where can I find those dll's that you mentioned?
|
|
|
|
|
Windows/System32 is where they need to end up, and where they will be to start with.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
How do I replace the msvcrt dll. When I try to copy the new one into the system32 folder I get a message saying that It cant be done because windows is using the dll.
|
|
|
|
|
If it's already there, it's already there.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
no error messages, just not functioning quite right.
|
|
|
|
|
Then you have the dlls you need, but the code is broken.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
|
thanks, that is exactly what i was after. i thought i had looked through the FAQ's pretty thoroughly, but obviously not
Cheers Mike, and thanks everybody else for your help.
|
|
|
|
|
If you used Visual Studio 2003 and using .net, then your program will not load if .net framework is missing from the computer.
Mostly these things happen because the environment on which the code was written has some dlls in the computer which are missing from that where it is deployed.
I suggest you start by installing .net framework on the machine where you want to deploy your program.
- Shailesh
|
|
|
|
|
Hello, I am a decent C++ programmer but a complete newcommer to GUI programming. I dont know all the terms, so please forgive me.
[the background]
I use MSVC++ 6.0, and create dialogs with their dialog program pictured here: help1.jpg. When that program compiles,and the user navigates through the menu and selects "About," the command is interpreted by the windows message processor: LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam). This is all great. I would like to know how to call a dialog resource as the window. This is where I am not making sense to anyone, so I will try very hard to explain myself.
[the question]
When a user wants to "have a control appear on the window" they call CreateWindow, and parent it to the window they want it to show up on. They have to fill out all the variables for each control and place them programatically. I would like to do all of this graphically via the dialog editor that MSVC++ provides. How can I do this?
Still not sure what I am talking about? Make the dialog take up that whitespace on the window in this image: help2.jpg
|
|
|
|
|
Create a dialog based application using the VC++ wizard. Place the necessary controls on the dialog box from the toolbar. Add member variables to the controls using classwizard. Initialize the variables at OnInitDialog function. And on execution that brings a dialog based application.
Hope this helps you ? .
PLEASE CHECK MSDN TO GET MORE INFORMATION
|
|
|
|
|
Ok, I'll try your suggestion.
|
|
|
|
|
I am a pretty decent C++ programmer but am brand new to graphics. I dont know what MFC is, and would like to know whether i should bother learning to use MFC or if I should just use the regular way to make win32 API's.
I would also like to know of some good MFC tutorials (either at codeproject or elsewhere) so I can just see whats up, because there are a lot of features I know nothing about.
|
|
|
|
|
The win32 API's are pretty complex, I always advise people to start with MFC, and then when you understand how that all works, delve into Win32 simply to learn what MFC is taking care of for you, so you understand what's really going on.
There are a ton of MFC projects here on CP, I'd say 95% of C++ tutorials would use MFC.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
...I always advise people to start with MFC, and then when you understand how that all works, delve into Win32 simply to learn what MFC is taking care of for you...
I took the complete opposite approach by spending a few years with the Win32 API and then about 1993 started learning MFC. In that regard, I appreciate what MFC does for me.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello,
I give up! I have wasted more time trying to figure out how to get the time/date that a file was last modified into a particular format.
Can someone please tell me how I can get it into a format like so:
Fri Sep 24 16:00:36 2004 GMT
Also, how can I get the content type of a file similar to how magic numbers work on linux?
Thanks,
Murrah Boswell
|
|
|
|
|
Take a look at GetDateFormat . It takes a SYSTEMTIME and outputs a formatted string.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Have a look at CFileTimeSpan and CFileTime class @ MSDN
|
|
|
|
|
Hi All,
I would like to add my own functionality to malloc:
Is it possible somehow to hook into this function (or between it and OS).
Thanks in advance,
boni
|
|
|
|
|
I'm not sure if this technique is possible in Windows, but it is under Unix with ELF loaders.
Write a shared library (.so - equivalent to .dll in Windows), in which you define extern "C" void* malloc(size_t s) . Then have the shared library to be preloaded before all other DLLs are loaded. Then the linker will not link the system malloc since it has already been loaded.
To chain your malloc with the system's malloc, you simply load the system shared library dynamically in your shared library, and retrieve the pointer to the system's malloc.
So, in your DLL you will have code kind of like this:
void* (*real_malloc)(size_t);
DllMain() {
HANDLE h = LoadLibrary("whichever_dll_that_contains_malloc.dll");
real_malloc = (void*(*)(size_t))GetProcAddress("malloc");
}
extern "C" __declspec(dllexport) void* malloc(size_t s) {
do_some_stuff();
void* ptr = real_malloc(s);
return do_something_more_perhaps(s);
} Then have the linker preload this DLL. I'm not sure it's possible in Windows, but I have a hunch it is. I know it's possible to hijack DLLs, and that's basically what this is. Needless to say, you'll need to link against the runtime dynamically.
--
Suche Wissen über Alles.
Der Student
|
|
|
|
|
I have sorting issue with MMC on Win2000 platform ( works fine on XP,2003)
Open Computer Management in MMC (compmgmt.msc), Select System Tools try to sort by Name on list control. Sorting fails ( Nothing happens ) Do the same on XP , 2003 works fine.
Anybody knows the reason ? And how solve it ?
Thanks
Sandeep Naik
|
|
|
|