|
Improperly interfacing between the hardware and software is there will cause pc damage. How to avoid this problem occurs? Is there any tutorial will helping in interfacing.....
|
|
|
|
|
It depends entirely upon what you are interfacing too? Obviously plugging your serial port into the mains power supply is going to cause a few problems... best advice is: don't do it unless you know what it is you are doing.
|
|
|
|
|
If there any website which can provided interfacing example or basic tutorial.How i have to do if i don't have knowledge about printer port interfacing.....
|
|
|
|
|
|
Thank you for yr suggestion Jonny.........
|
|
|
|
|
How to obtain the original length and height of a window (as they were defined in the the resource file) or is there a function which restores the window to it's original size?
|
|
|
|
|
you can enumerate resources of the executable
containing that dialog box if the window is a dialog
which is created from resources. take a look at
this API documentation : EnumResourceNames()
but to identify which resource corresponds to that
window you need to compare window names, or if the
name is modified, you need to compare its contents.
but about a simple API that does the job, at least
I haven't heard of.
|
|
|
|
|
CRect rc;
GetWindowRect(rc);
rc.Width();
rc.Height();
|
|
|
|
|
Hello.
I was using Microsoft Slider Control ActiveX ( the one with comes with mscomctl.ocx ) without problems but now, I have tested in Windows Server 2003 and it doesn't works.
I have tried to create a simple HTML page that only displays the slider, and in Windows Server 2003 the slider is not displayed-
Anyone can help me ??
Thanks
|
|
|
|
|
i am trying to read a text file "japan.txt" which contains two coloumn of data
44,245
34,456
...
however when i try to convert each number from char to double the atof function
somehow doesn't work (c[i][j] = atoi(token);) (when i check what is c[i][j] it gives me 0)
any help greatly appreciated
thanks
barb
void tokenizer(){
char c[22][2]
char b[20];
char* token;
ifstream file;
file.open("japan.txt");
while (!file.eof()){
for (int i = 0; i< 21; i++) {
file.getline(b,' '); // read each line from file
int j = 0;
token = strtok(b," , ");
while (token != NULL){
//printf("dec1: %s\n", token);
c[i][j] = atoi(token); // convert from char to double
j++;
token= strtok(NULL," , ");
}
}}
}
|
|
|
|
|
Hello Barbara,
I don^t know if it is intentional but the code you send seems kind of erroneous.
first your array c is of type char, and yet you wanted to perform the line:
c[i][j] = atof(token);
char is one byte long, return value of atof is 8 bytes long...
also atoi returns integer, sizeof int on my station is still 4 bytes.
So you would lose precision because of truncation (eg all strings representing a value bigger then 256(in the atoi case) would not be converted correctly), in the atof case simply all strings would be incorrect.
Second you presume the line will never contain more then 2 tokens (which is your right offcourse), but if I were you(which I`m not) I`ld make sure that j never gets bigger then 2.
Third, you might want to check if your txt file is ANSI format or Unicode, make sure it is ANSI if you want to work with normal char strings, othewise use wide character strings.
Fourth, I'm not sure about that one but the getline function doesn^t it take as second parameter the size of the buffer?....
Anyway, I hope these remarks may help you.
Greetz,
Davy
|
|
|
|
|
GDavy wrote:
first your array c is of type char, and yet you wanted to perform the line:
c[i][j] = atof(token);
Or maybe that she was actually using atoi() !! It's probably going to be all of the things you mentioned.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi,I am asking for help!
I built a project by using VC++,and wanted to debug it.
But after I started to debug,it displayed something like assembley code,and said cannot set a breakpoint at the cursor location.
And the error msgs about debug are :
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Tcl\bin\tcl83.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\opengl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\glu32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ddraw.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\dciman32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\lpk.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\usp10.dll', no matching symbolic information found.
The program 'D:\Thesis\OpenSees\Win32\bin\openSees.exe' has exited with code 0 (0x0).
I don't understand what's going on.
Anybody knows that?
|
|
|
|
|
1. Try to clean the project and rebuild all
2. May be u have used such controls in your application which don't let u start your application
|
|
|
|
|
You probably built a Release build without debugging information. Select 'Win32 Debug' from the Build toolbar, or select 'projectname - Win32 Debug' in the Build > Set Active Configuration dialog. Then try again. (Instructions for VC 6.0).
If you want to debug the release build, it can be helpful to create debugging information. You can do this by selecting 'Program Database' under Debug Info on the C/C++ tab of the Project > Settings dialog, and ticking 'Generate debug info' on the Link tab. Ticking this box disables a release-mode optimization, which you can turn back on by adding /OPT:REF to the Link Options box.
The 'error messages' are simply the debugger telling you which DLLs were loaded. 'No matching symbolic information' indicates that the debugger couldn't find debugging symbols for these DLLs: this is not a problem, unless you find yourself stopped in the middle of the DLL. If you want to, you can download debugging symbols from Windows Hardware and Driver Central[^]. However, these don't include debugging symbols for security patches; these used to be contained in the patch package but don't appear to be any more.
If you need to, you can get Visual Studio .NET to download symbol files from a Microsoft server on demand. See HOW TO: Use a Symbol Server with the Visual Studio .NET Debugger[^] for more details on this.
|
|
|
|
|
Hello !
I am trying to develop a systray application using MFC.
NOTE: I am beginner.
I performed that application sucessfully, therefore, when I run the program I can see the icon on the systray, but, I also see the dialog window open as well.
When the program runs the following lines:
CTrayIco dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.Modal();
the dialog windows appears, and I don't want to show it. I tried to delete these lines, but, the program didn`t run fine.
I would like to put the icon on the systray as soon as I run the program without any dialog window.
How can I do that ?
Thanks in advance.
|
|
|
|
|
Yes, I am assuming that these lines of code are in you InitInstance() function.
You see the CWinApp class has a m_pMainWnd member which needs to be set to point to a window class, so messages can be pumped to it. If this member is NULL the CWinApp class receives a WM_QUIT message and terminates.
So, you need a main window of some sort which should exist for the lifetime of your application. If you don't want to see it just create a window without the WS_VISIBLE flag set. But you must have some window and set the CWinApp::m_pMainWnd to point to it.
|
|
|
|
|
you need to start your MFC modal dialog program with a hidden
dialog, and the only way I found for this problem
was to call ShowWindow(m_hWnd, SW_HIDE) in one of
WM_NCPAINT or WM_PAINT message handlers.
There is another way for this problem, but needs
a little more modification of your program.
The normal way would be to uncheck WS_VISIBLE
style in resource editor, and start you dialog
using CreateDialog , then make a message loop
there by calling AfxPumpMessage in a loop like
this:
CMyDlg mydlg;
mydlg.Create(IDD_MYDIALOG);// that IDD_MYDIALOG is
// the dialog resource id,
// you can find it in your
// dialog class definition
// (TrayIco.h as you said)
// in a line like this:
// enum { IDD = IDD_MYDIALOG };
// if you wanted to show dialog window
// ShowWindow(m_hWnd, SW_SHOW);
while(AfxPumpMessage()); // loop till the QUIT
// message comes.
|
|
|
|
|
Everybody know that we can call DOS interrupt fuction by using "int" keyword
for example:
mov ah,4
int 1ah
Do you know how to call a interrupt function in VC6 or in a driver?
Appreciate for any suggestions!
|
|
|
|
|
the programs you run are in User Mode( ring-3 applications, you can read more about this in intel processors specifications). They cannot run INT commands( and many others, they are called priviledged op codes, see the reference above).
And if anyway you could do it (I mean if you write a
device driver and call the above INT command), many
INTs don't have the functionality you have
seen before in old days of real-mode OSs like DOS.
|
|
|
|
|
Somebody said to me
that we can use IoConnectInterrupt function
but I don't know how to use this function
My aim is to get the real date of CMOS
At first, I want to call Interrupt 0x1a, function 4. However, this could restart my computer when running to the code
Then I read register 0x32 of CMOS to get the century, such as 19 century of 1999. Here exists a problem. Register 0x32 of CMOS can not be the real century of year. Have you some way to make it to be the real century? Or have you some other way to get the real date?
Appreciate your answer!
|
|
|
|
|
If you want the system time, use GetSystemTime .
You're out of luck, if you want to read the CMOS data, unless you write a device driver. Even then you'll need to read the addresses directly rather than using the BIOS, because Windows has replaced the interrupt handler table.
|
|
|
|
|
if you are using windows 98 or 95 you can call
interrupts, but on xp & 2k no way there from user
mode applications!
that function IoConnectInterrupt is for device
drivers, and does not do what you need.
anyway, you can use some device drivers like ntport
to have direct access to ports, then you can
use direct port access and so you can read CMOS.
( so no need to use the interrupt, but you
have to know how to read CMOS using in/out OPs)
anyway it's a long way. if you have any other
alternatives, I recommend you to review them,
maybe you are going the hard way...
|
|
|
|
|
Hi
Now I can access to CMOS registers by device driver. Only a pity is that the century value is not very right. For the data read from 0x32 register is not the realtime value.
Thanks for your attention!
|
|
|
|
|
I am trying to set a window to process notifications from directoshow like so:
cTrailer.pEvent->SetNotifyWindow((OAHWND) hwndNotify, WM_GRAPHNOTIFY, 0);
But I keep getting the following compile error:
error C2039: 'SetNotifyWindow' : is not a member of 'IMediaEvent'
I am using Visual C++ 6.0 and Direct X SDK 9.0
The strange thing is that in the sample code and the documentation, this is how it is done. What little settings am I missing here?
|
|
|
|