|
This is on an XP machine. What I tried to do was to logon to my domain account from my domain account. Maybe this is making the problem? Is there difference between local and domain accounts here?
|
|
|
|
|
Hi!
I've seen in some code examples this word in head of functions, but I don't know what's its meaning... Any idea?
Thank you
|
|
|
|
|
It's a macro, that expands to HRESULT __stdcall . HRESULT is the standard return value of COM methods and __stdcall specifies calling convention (for details see MSDN).
Robert-Antonio
"I launched Norton Commander and saw, drive C: on the left, drive C: on the right...Damn, why I need two drives C:??? So I formatted one..."
|
|
|
|
|
Thank you
|
|
|
|
|
Hi,
I am trying to get the exact character widths (and thus position/placement) of Arabic text which I am writing to the screen.
I have used GetCharacterPlacementW. This returns the Caret position, corresponding to the cursor position between the characters.
For English text, this correctly gives the exact position.
For Arabic, this makes a good attempt at getting the position. However, in some parts of the text, the character positions become quite inaccurate.
Screen images can be seen at:
http://www.codeguru.com/forum/showthread.php?s=&threadid=283418
Apart from the GDI32.dll GetCharacterPlacementW, is there another more accurate technology?
Does anyone have any other suggestions?
Many thanks.
|
|
|
|
|
Hi all,
Wondering if anyone knows why I'm getting this error when i try to build certain DirectShow samples from the DX9SDK. Here's what i get compiling a debug
------ Build started: Project: PlayWnd, Configuration: Debug Win32 ------
Linking...
playwnd.obj : error LNK2019: unresolved external symbol "long __stdcall ATL::AtlWinModuleInit(struct ATL::_ATL_WIN_MODULE70 *)" (?AtlWinModuleInit@ATL@@YGJPAU_ATL_WIN_MODULE70@1@@Z) referenced in function "public: __thiscall ATL::CAtlWinModule::CAtlWinModule(void)" (??0CAtlWinModule@ATL@@QAE@XZ)
playwnd.obj : error LNK2001: unresolved external symbol "class ATL::CAtlBaseModule ATL::_AtlBaseModule" (?_AtlBaseModule@ATL@@3VCAtlBaseModule@1@A)
.\Debug/PlayWnd.exe : fatal error LNK1120: 2 unresolved externals
There are certain samples (with names ending in ASF) that require the Windows Media SDK and a certificate. But PlayWnd isn't one of them. (PlayWndASF is.)
I'm working on a full screen video player, the other relevant samples that play video also give me the same error. "Windowless" for example.
I know it's something stupid...
|
|
|
|
|
How can I messure the memory consumed by a function ?
I use APIs to allocate GDI objects (bitmaps - pens -etc...)
and I want to compare several approaches in my Application so I want to know how much memory is consumed
any links ideas are appreciated.
|
|
|
|
|
Quite honestly, you are probably wasting your time. In any case, read this article just to be sure.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
hi,
table containing fileds code,name. in the name field i need query to retrive repeated datas and code is not same. any one help to me. thanks in advance.
Have A Nice Day!
Murali.M
|
|
|
|
|
Other than a table in a database having two columns, code and name, I do not understand your question.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
actually i didnt understand that either, till i read ur reply.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
And after reading my reply, you now understand it??
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Yeah the first 4 words
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
Do you mean something like
select name, code from [TABLE] group by code, name
|
|
|
|
|
I am looking for some library or class for parallel port access in windows 2k or XP ( reading and writing to a parallel port) preferably for VC 6 . I have already tried inpout32.dll but it is giving some xception on windows 2003 server. Any help in this regard will be highly appreciated.
Muhammad Shoaib Khan
http://geocities.com/lansolution
|
|
|
|
|
Start here[^]. The Platform SDK contains the resources needed to use serial and parallel I/O. This link is to the MSDN library section that discusses how to implement device I/O, including LPT ports. The section on Communications Resources includes a reference section describing the process and functions needed.
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
Although it does say this: A communications resource is a physical or logical device that provides a single bidirectional, asynchronous data stream. Serial ports, parallel ports, fax machines, and modems are examples of communications resources. For each communications resource, there is a service provider, consisting of a library or driver, that enables applications to access the resource.
I do not see anything that is directly related to lpt ports. There is stuff there for Modems and COMM though...
John
|
|
|
|
|
Create a handle to LPT ports[^]. That's all there is. I've tried for years to find more from MS, but they don't want us to know. I assume once you get a handle that some of the other functions work on parallel ports, but it will take some experimenting to make them work. You could try using MSComm32 from VB; it is well documented and usable. If anyone figures it out, this would make an excellent article for CP.
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
Mostly like reading and writing a file: (EXAMPLE - your mileage may vary...)
void CSerialPort::initPort(int comNumber, int baudRate)
{
closePort();
m_ComNumber = comNumber;
m_BaudRate = baudRate;
CString comStr;
comStr.Format(_T("%s%d"), _T("COM"), comNumber);
m_ComHandle = CreateFile(comStr,
GENERIC_READ | GENERIC_WRITE,
0, 0,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
0);
DCB dcb;
GetCommState(m_ComHandle, &dcb);
dcb.BaudRate = m_BaudRate;
dcb.ByteSize = 8;
dcb.Parity = NOPARITY;
dcb.StopBits = ONESTOPBIT;
SetCommState(m_ComHandle, &dcb);
COMMTIMEOUTS timeouts;
timeouts.ReadIntervalTimeout = MAXDWORD;
timeouts.ReadTotalTimeoutMultiplier = 0;
timeouts.ReadTotalTimeoutConstant = 0;
timeouts.WriteTotalTimeoutMultiplier = 0;
timeouts.WriteTotalTimeoutConstant = 0;
SetCommTimeouts(m_ComHandle, &timeouts);
EscapeCommFunction(m_ComHandle, SETRTS);
EscapeCommFunction(m_ComHandle, SETDTR);
}
bool CSerialPort::readByteFromChannel(char* inByte)
{
DWORD numRead;
BOOL ret = true;
ret = ReadFile(m_ComHandle, inByte, 1, &numRead, 0);
return ( (ret) && (numRead == 1) );
}
void CSerialPort::sendPacket(char* pktBuffer, int len)
{
DWORD numWritten;
WriteFile(m_ComHandle, pktBuffer, len, &numWritten, 0);
if (numWritten != (DWORD)len)
// do comm error handling here
}
|
|
|
|
|
This is for a serial port not parallel...
John
|
|
|
|
|
sorry...embarrassed...
Must have serial port WAY too embedded in my brain right now to
read "parallel" as "serial"...
Apologies if it created confusion for the original poster.
John
|
|
|
|
|
I have a file with stuff like:
11 45 67
12 17 11 60
15 17 89
17 5
etc where the line ends with a carriage return but theres no set spacing between the integers. The only thing I know is that each integer is two digits, but theres no restriction on how many per line and spacing. I want to read each integer into a variable (that I'll pushback onto a vector). I saw fread, and fgets but they dont seem to look like they will do.
thanks,
ns
|
|
|
|
|
ns wrote:
I saw fread, and fgets but they dont seem to look like they will do.
One option is to read each line in, using fgets, or the stl's stream such as istrstream. Then use _tcstok() to separate the space delimited integer strings. After that you can then use _ttoi to convert each string to an integer value.
I Dream of Absolute Zero
|
|
|
|
|
Hey,
This is how you can do it in C++:
#include <fstream>
#include <vector>
int main() {
std::ifstream fin("test.txt");
fin >> std::skipws;
std::vector<int> test;
int j;
while (fin >> j)
test.push_back(j);
return 0;
}
Hope that helps you.
--
Henrik Stuart (http://www.unprompted.com/hstuart/)
|
|
|
|
|
Good Soultion, Thanks. I learn something new every day just reading these posts...
John
|
|
|
|