|
Virtual serial port dirver.
My God is more powerfull Than Your God.
|
|
|
|
|
Is virtual port and virtual device same?
|
|
|
|
|
You said you want usp port, this software gives you face usb port, i dont know how how exactly you are going to use it. but still this software is worth trying out.
My God is more powerfull Than Your God.
|
|
|
|
|
What I want to do is the following: (1) create a GraphicsPath; (2) create a second GraphicsPath, (3) create a Region for each path using the constructor Region(GraphicsPath*); (4) intersect these two regions getting a Region* for the intersection. Now the question: how to construct a GraphicsPath around this intersection region ? If there would be something like GraphicsPath(Region*) I wouldn't ask this question
|
|
|
|
|
Hi, how in Gods name, do i get the doman or workgroup name to wich my computer belongs to?
i cant use GetComputerNameEx() cause the app must also run on W9x machines.
ibe searched google, the msdn (online and my cd) and found nothing!
i cant belive something so apparently simple would be so hard to find!
the only thing i can think of right now, is to do the whole WNetopenEnum() / WNetEnumResource() stuff, look for my computer name, check from wich container i got it, etc.
Theres GOT to be an easier way! Please help
Thanks!
|
|
|
|
|
Hi,
Get the Local host name and use Netbios call to get Domain name. Iam not sure whether Netbios will return Workgroup name... Anyway, check out it...
It will be helpful!!
Best Regards,
A.Ilamparithi
|
|
|
|
|
Try Q155698, howto: retrieve current user and domain names on Windows 95 and 98.
However, it requires use of 16-bit code, so you need to use thunks. The article points you at other articles, explaining how this can be done.
Steve S
|
|
|
|
|
My application must do something when its main window is minimized.What message is sended when a window is minimized?
Thank you!
Yeetang
|
|
|
|
|
WM_SIZE.
Add an OnSize handler with the class wizard and check the nType parameter for SIZE_MINIMIZED.
You might want to read about this in MSDN.
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
|
Hello, everyone!
I want to get the document file name associated with a MSWord process, for example "document 1" when you do not assigned a file name of the word application. I have get the process ID of the MSWord process and surely the HANDLE of the MSWord appication.
Are there some APIs that I can use? Can you provide me some sample codes?
Thanks in advance,
Geo
|
|
|
|
|
Due to the fact that the document name is displayed in the title bar, you can get it from there.
1.Get HWND to the Word application in question (Look up ::FindWindow)
2.Send a WM_GETTEXT message to this particular window (Look up ::SendMessage)
Peter Molnar
|
|
|
|
|
i downloaded this code and it's in c++. it's suppose to read the cpu temperature and display the result but i can't get it to run. can someone please massage it and help me get it to run becuase i don't know c++ that well. it's suppose to get the cpu temp from a winbond W83697HF/F chip.
thanks,
Rob Tomson
//
// Simple Winbond W83697HF/F chip motherboard and cpu temp reader
// Require giveio.sys driver under winXP/2000/NT
// Used compiler: visual C++ 6
// Autor: Sander Aiaots
// E-Mail: san@ejaam.com
// I also do not take any responsibility if this program should harm your computer
//
#include <iostream.h>
#include <windows.h>
#include <conio.h>
// By the manual we have two ports to use
// 0x295 - the INDEX port and
// 0x296 - the DATA port
#define INDEX 0x295
#define DATA 0x296
#define BANK_SET 0x4e // lowest three bitti set a bank, in manual lk97 and lk109
#define CPU_TEMP 0x50 // BANK 0 0x4e = xxxxx001
#define MBM_TEMP 0x67 // 0x4e = xxxxx000
// lets give us a direct I/O access under winXP/2000/NT
// this part is not needed under win9x
int inline openIO(){
HANDLE h;
h = CreateFile("\\\\.\\giveio", GENERIC_READ, 0, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if(h == INVALID_HANDLE_VALUE) {
cout << "Couldn't access giveio device\n";
return 1;
}
CloseHandle(h);
return 0;
}
int main(){
// lets give us a direct I/O access under winXP/2000/NT
// this part is not needed under win9x
if(openIO()) return -1;
// Set Bank register to BANK0
_outp(INDEX, BANK_SET);
_outp(DATA, _inp(DATA)|0x01);
//
_outp(INDEX, CPU_TEMP);
cout << "CPU temp: " << _inp(DATA) << "C\n";
// lets unset BANK register, to get Motherboard temperature
_outp(INDEX, BANK_SET);
_outp(DATA, _inp(DATA)&0xf8);
_outp(INDEX, MBM_TEMP);
cout << "MBM temp: " << _inp(DATA) << "C\n";
return 0;
}
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
If you are running Windows XP/2000/NT, you must download and install the GiveIO device driver, which this code fragment is using.
Here is a link: GiveIO Device Driver[^]
Under Windows 98/Me, this driver is not required, as each application may read or write data from any port.
If you are running Windows 95/98/Me, I suggest you comment out the lines in the main function where OpenIO method is called. Otherwise the program will always fail to open the port, and thus the main function will cease it's execution.
Remember that this particular piece of code has no security-checks applied: REMEMBER TO CHECK THE PORT DESIGNATIONS AND DATA LENGTHS ON YOUR VERY OWN MANUAL AND POSSIBLY WITH THE MANUFACTURER OF YOUR MOTHERBOARD / CPU BEFORE RUNNING THIS PROGRAM.
Otherwise, the ports the program writes to/reads from might be incorrect, and thus result in data being written to somewhere where it does not belong. Such operations may cause a system-wide failure or even damaged hardware. I suggest you consult with the maker of your motherboard to make perfectly sure that the ports specified in the file are correct. If you do not, then the risks are entirely yours.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi!
I am writting a static library. I noticed it does not export any of the templated functions. I have been looking all over MSDN to see if there is any issue with static library and templates but nothing so far.
So the question is, is it possible to use a template function in a statically linked library?
Thanks for your answers,
Rob
|
|
|
|
|
Robert Buldoc wrote:
So the question is, is it possible to use a template function in a statically linked library?
Yes. Remember that for this to work all of the implementation of the template must be in the header file.
John
|
|
|
|
|
Well, if the template functions is implemented in the header file they are not really located in the library. The code generated by the compiler will be in the client of the library, not in the library. It cannot be any other way as the template functions are compiled when they are used. The library can't have any prior knowledge of which specializations of the template will be used.
The only way to export template functions (that I know of) is to explicit instantiate the functions in the library. See MSDN Q239436 for an explanation. However, if you explicit instatiate template member functions on VC++ 6.0 you get an internal compiler error!
br
Steen
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Steen Krogsgaard wrote:
The only way to export template functions (that I know of) is to explicit instantiate the functions in the library.
Putting template functions in a library is the same as putting template source code in a .cpp. Unless you explicitlty instantiate it you can not use it outside of the .cpp file it is defined. That is why in most cases you must put it in the header file. See the following link:
http://www.codeproject.com/cpp/templatesourceorg.asp[^]
Steen Krogsgaard wrote:
However, if you explicit instatiate template member functions on VC++ 6.0 you get an internal compiler error!
I believe I have done this with dlls but most of the time I put all the header source code in the header file because I can not possibly explicitly instantiate all possible combinations of things I will want to use with the template.
John
|
|
|
|
|
I think we agree. I just don't see the sense of putting the template definition/implementation in a dll library if it is never being instantiated in the library. And I agree that explicit instantiations goes against the whole idea with templates.
The internal compiler error (C1001) is confirmed by MS and documented in Q179271. It happens when you have more than one explicit instantiation (which must be quite common, otherwise there is no reason to use templates in the first place )
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Steen Krogsgaard wrote:
I just don't see the sense of putting the template definition/implementation in a dll library if it is never being instantiated in the library.
I do this because I package all my dlls with their own installer and it makes it easier to use and keep only one version of the templates if they are packaged with related classes. In general the classes of the dll may use the templates internally but for the most part they don't use them externally.
Steen Krogsgaard wrote:
The internal compiler error (C1001) is confirmed by MS and documented in Q179271.
I'll take a look at that. I find it hard to believe that I don't have more than one explicit instantiation somewhere in my dll interface code but its possible.
John
|
|
|
|
|
John M. Drescher wrote:
I'll take a look at that. I find it hard to believe that I don't have more than one explicit instantiation somewhere in my dll interface code but its possible.
It's only a problem in VC++ 5.0 and 6.0, the problem was corrected in VC++.NET (mentioned in Q179271 available online. The one I quoted was from my October 2001 MSDN CDs).
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
I have a multiple object solution. How do I call from project2 a method in
project1? I thought it is project1.method1();. Also, do I need to add
header and other stuff to project1 so that it knows how to find method1?
If there is some sample code available on line, that would be easiest.
The projects are a mixture of C#, C++, and C. I am most interested in the
C or C++ angle.
I would have search for the solution, but I have no idea what keyword to begin with. Thanks.
glam
|
|
|
|
|
I meant multiple project solution.
glam
|
|
|
|
|
> How do I call from project2 a method in project1?
In C/C++ CreateRemoteThread should do it.
> Also, do I need to add header and other stuff
> to project1 so that it knows how to find method1?
Simply pass the address of ThreadFunc from project1 to project2 via some kind of IPC (Interprocess Communication).
RK
|
|
|
|
|
I have created a DDB bitmap of size (1024x2048) and have selected it into a
compatible DC. Here is the code:
hdc = GetDC (hwnd);
hBitmap = CreateCompatibleBitmap (hdc, 1024, 2048);
hdcMem = CreateCompatibleDC (hdc);
SelectObject( hdcMem, hBitmap);
ReleaseDC (hwnd,hdc);
My problem is when I draw on the hdcMem and then bitblt it to my Window DC.
Everything works fine until I try a bitblt with an X coordinate (hdcMem)
greater than 800. My current screen Resolution is 800x600. Why is this?
How can I fix it? This is not a problem for the Y axis. I suspect that the
hdcMem has some sort of limitations based on the current resolution, but I
can't figure it out.
What happens is that the bitmap seems to be cut in half. The bitmap displays fine up to the 800 point, but after that, it doesn't show at all.
|
|
|
|