|
Hello, sir:
I have a matter that how to detect the vendor of audio codec. I want to know the vendor of my sound codec, just Reltek, C-Media or Ati and so on. But I don't know how to detect it by Micorsoft API. Can you tell me some about it? I hope your help, thanks.
|
|
|
|
|
Hi,
I utilize Visual C++ 6.0 and MFC for many years.
I want to know a few suggestions of books to do a transition toward Visual Studio. NET, preferably C++.
I don't need web development now. I have remark that many books about Visual Studio.NET include web development. I am looking for a bok specifically for Visual C++ in the .NET IDE.
Thanks for any suggestions,
Claude
|
|
|
|
|
Hello,
Did you mean Managed C++ or unmanaged C++ ?
With Regards,
R.Selvam
|
|
|
|
|
Sorry, i post this question in here. But i really cant find any other discussion board related to assemble language.
now i am trying to use inline assemble of C++ to access the parallel port. But the problem is my platform is windows NT, so what i want to ask is if there is any method for me to access the parallel port by inline assemble in C++. btw i hv the admin right of my PC.
thank u guys in advance!!!!!!!!!!! =)
|
|
|
|
|
You need to write a device driver for that. There should be several free ones on the net that already do the work for you.
John
|
|
|
|
|
|
We had some success using winio from http://www.internals.com/[^] last time we were doing this at uni.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
hi:
I want to read the CD_ROM MODE2 sectros,but I don't know what's wrong with the code.The "Result" is TRUE and "error" is 0,but there is no data in the "lpSector".
who can help me.
thank you very much
hCD = CreateFile ("\\\\.\\M:", GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);
RAW_READ_INFO raw_info;
ZeroMemory(&raw_info,sizeof(raw_info));
raw_info.DiskOffset.QuadPart =2000*2352 ;
raw_info.SectorCount = 10;
raw_info.TrackMode = YellowMode2;
Result=DeviceIoControl(hCD, IOCTL_CDROM_RAW_READ,
&raw_info, sizeof(RAW_READ_INFO),
lpSector, dwSize,
&dwNotUsed, NULL);
DWORD error=GetLastError();
WriteFile (hFile, lpSector, dwSize, &dwNotUsed, NULL);
|
|
|
|
|
How about ReadFile() instead of WriteFile()?
John
|
|
|
|
|
Using ReadFile can't read CD_ROM MODE2 FORM2,
First all ,thank you very much
|
|
|
|
|
I am a little confused. You can not expect to read anything with a WriteFile()?
[EDIT]
Oh... I see you are trying to do the read with DeviceIoControl.. I got confused by the WriteFile part..
[/EDIT]
John
|
|
|
|
|
Sorry for the confusion. I am not sure of the answer. And it looks like it will be a difficult question to find an answer as there are not too many hits when I search the net for IOCTL_CDROM_RAW_READ.
John
|
|
|
|
|
I want to do another thing with WriteFile,
I have used ReadFile,but it can read MODE1 and MODE2 FORM1,can't read MODE2 FORM2.
So I want to read MODE2 with DeviceIOContrl and IOCTL_CDROM_RAW_READ
but there is no data in the buffer
|
|
|
|
|
I am trying to constrain the resizing of a MDIChildWnd to maintain a given aspect ratio. I am having no luck. The best I have been able to do is in the CWnd::OnSize function to look at the new size, calculate what a properly proportioned frame should be and call CWnd::SetWindowPos. I almost get what I need, it is just there is no frame around the client area. Annyone have any ideas?
|
|
|
|
|
Take a look at CWnd::OnSizing and CWnd::CalcWindowRect
John
|
|
|
|
|
I'm having some trouble with static members in my program. This is what my code looks like:
<br />
#ifndef TIMER_H<br />
#define TIMER_H<br />
class Timer<br />
{<br />
private:<br />
static LARGE_INTEGER m_lTicksPerSecond;<br />
static LARGE_INTEGER m_lTime;<br />
static LARGE_INTEGER m_lFirstTime;<br />
Timer();<br />
public:<br />
static bool Initialize()<br />
{<br />
if(QueryPerformanceFrequency(&m_lTicksPerSecond) && QueryPerformanceCounter(&m_lFirstTime))<br />
return true;<br />
return false;<br />
}<br />
static double MsSinceStart()<br />
{<br />
QueryPerformanceCounter(&m_lTime);<br />
return ((double)(m_lTime.QuadPart - m_lFirstTime.QuadPart ) / (double)m_lTicksPerSecond.QuadPart ) * 1000.0;<br />
}<br />
};<br />
#endif<br />
Or you can check it out at http://www.rafb.net/paste/results/SD400728.html (don't know if codeproject supports the formating).
Anyway, the error I'm geting is:
error LNK2001: unresolved external symbol "private: static union _LARGE_INTEGER Timer::m_lFirstTime" (?m_lFirstTime@Timer@@0T_LARGE_INTEGER@@A) on every member. The program it self is a win32 application.
Grateful for any help
|
|
|
|
|
You should define all static members in the timer.cpp file, e.g.
LARGE_INTEGER Timer::m_lTime; .
Robert-Antonio
|
|
|
|
|
I'm sorry but I can't get it to work :/
When I place LARGE_INTEGER Timer::m_lTime etc inside my .cpp file it begins to talk about redefinition errors.
If I remove LARGE_INTEGER m_lTime etc from my .h file it says 'm_lTime' : is not a member of 'Timer'.
could you write just a simple class with a static member explaining it to me?
|
|
|
|
|
Did you define m_lTicksPerSecond, m_lTime,m_lFirstTime and in your cpp file.
LARGE_INTEGER Timer::m_lTicksPerSecond=0;
LARGE_INTEGER Timer::m_lTime=0;
LARGE_INTEGER Timer::m_lFirstTime=0;
Also have you checked out this:
http://www.naughter.com/cputicker.html[^]
Removing the mfc part only takes a few seconds...
John
|
|
|
|
|
oki, I checked out the cputicker class but still can't figure out what I'm doing wrong, perhaps I'm geting blind to my code.
This is what my 2 files looks like now:
Timer.h
<br />
#ifndef TIMER_H<br />
#define TIMER_H<br />
class Timer<br />
{<br />
protected:<br />
static LARGE_INTEGER m_lTicksPerSecond;<br />
static LARGE_INTEGER m_lTime;<br />
static LARGE_INTEGER m_lFirstTime;<br />
Timer();<br />
public:<br />
static bool Initialize();<br />
static double MsSinceStart();<br />
};<br />
#endif<br />
and this is what Timer.cpp looks like:
<br />
#include "Timer.h"<br />
<br />
LARGE_INTEGER Timer::m_lTicksPerSecond = NULL;<br />
LARGE_INTEGER Timer::m_lFirstTime = NULL;<br />
LARGE_INTEGER Timer::m_lTime = NULL;<br />
<br />
bool Timer::Initialize()<br />
{<br />
if(QueryPerformanceFrequency(&m_lTicksPerSecond) && QueryPerformanceCounter(&m_lFirstTime))<br />
return true;<br />
return false;<br />
}<br />
double Timer::MsSinceStart()<br />
{<br />
QueryPerformanceCounter(&m_lTime);<br />
return ((double)( m_lTime.QuadPart - m_lFirstTime.QuadPart ) / (double) m_lTicksPerSecond.QuadPart ) * 1000.0;<br />
}<br />
and this is the error which seems relevant: error C2039: 'm_lFirstTime' : is not a member of 'Timer' (which it as you see is)
hehe, plz bare with me
|
|
|
|
|
I am not sure what the problem is. Check to make sure that your cpp file is indeed included in your project and it is compiling...
As for the link, since I saw you were trying to do some work with high resolution timers I thought the code there may save you some work...
John
|
|
|
|
|
How is LARGE_INTEGER defined? Aren't there any macros that interfere with your variable names?
The simple example of declaring static members is:
pruba.h:
class A
{
static int b;
};
pruba.cpp:
#include "pruba.h"
int A::b = 1;
Robert-Antonio
"Science is a differerntial equation.
Religion is a boundary condition."
|
|
|
|
|
Hi!
I've been programming C++ for almost 4 years now, but this one is getting me mad
if(!(bMouse4Old == bMouse4 == false))
SendInput(1, &inputMouse4, sizeof(inputMouse4));
both bMouse4Old and bMouse4 are false , but the "SendInput()" is being called nonetheless.
Why?
The statement means: "if bMouse4Old and bMouse4 are the same, namely false, do not call SendInput" (hence the "!")
thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Goodness knows how this will be evaluated, but I doubt it will be the way you hope.
if (bMouse4Old == false && bMouse4 == false)
is the way to go.
or perhaps
if (! (bMouse4Old && bMouse4))
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
if (bMouse4Old == false && bMouse4 == false)
This is the one I would use. The original code even if it worked is much harder to read and you are not saving anything by this kind of simplification as the compiler would surely optimize this statement.
John
|
|
|
|