|
Actually, I gave up in 2007 to investigate further on that topic since it was not a customer request but an internal one and we decided not to put more effort in it. So I guess I wont't be a big help here at least not in finding the right byte.
Of course I can offer you to run a compiled test program with the printers we have installed here in my office. I don't want to grab your sourcecode, so if you say you have something compiled already and want some testing on additional printers, you're very welcome!
Maybe if I find some time this week I could at least test if our printers have the N-up byte at the same location in the DEVMODE structure, but we're in the middle of pushing out a new release of our software this week, so I'll be busy with patching and testing most probably
|
|
|
|
|
Is there any VC++6 function that can be used to restart or end the opperating system?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
|
Thamks!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
|
Thanks!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
|
|
Thanks again!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Hi all...
I'm looking for a good toolkit (with source) that will help me build a character based user interface for console applications using C++ in Visual Studio 2005. I'm doing a retro app, and I can't seem to find a good tool-kit that will let me define windows with different characteristics (allow word wrap, scrolling, borders, etc) and (preferably) use ANSI escape code graphics. Anyone know of a good one? I kinda want the source to go with it, so I can muddle around with it and see how they do things (doesn't everyone?). Appreciate any help...
=->Mocs<-=
|
|
|
|
|
Does anyone know of any methods for successfully reading an Excel worksheet that has been copied to the clipboard? It would need to be in BIFF8 format.
|
|
|
|
|
Hi,
I have a CListCtrl derived class, where I want control over the subitem painting. The control is in report mode with some subitems. The insertion of items seems to work but nothing appears in the control since I draw all the subitems myself. I figured out that the subitem prepaint stage is never called. The item prepaint stage on the other hand gets called.
What could could be the reason for this problem ?
void CXListCtrl::OnCustomDraw(NMHDR *pNMHDR, LRESULT *pResult)
{
NMLVCUSTOMDRAW *pLVCD = reinterpret_cast<nmlvcustomdraw *="">(pNMHDR);
// Take the default processing unless we set this to something else below.
*pResult = CDRF_DODEFAULT;
// First thing - check the draw stage. If it's the control's prepaint
// stage, then tell Windows we want messages for every item.
if (pLVCD->nmcd.dwDrawStage == CDDS_PREPAINT)
*pResult = CDRF_NOTIFYITEMDRAW;
else
{
if (pLVCD->nmcd.dwDrawStage == CDDS_ITEMPREPAINT)
// This is the notification message for an item. We'll request
// notifications before each subitem's prepaint stage.
*pResult = CDRF_NOTIFYSUBITEMDRAW;
else
{
// ***** This block of code gets never called. *****
if (pLVCD->nmcd.dwDrawStage == (CDDS_ITEMPREPAINT | CDDS_SUBITEM))
{
// This is the prepaint stage for a subitem.
:
:
}
}
}
}
tia
|
|
|
|
|
How can I record and play sound file in mp3 format ?
|
|
|
|
|
I assume you mean programmatically...
For capturing and rendering audio samples there's
(included with Windows):
Windows Multimedia Audio[^]
DirectSound[^]
For compressing/decompressing PCM samples to MP3 you
could use the Audio Compression Manager (ACM)[^]. You'll
need an ACM-compatible MP3 codec to use ACM.
There's no MP3 codec included with Windows, but there's
some available from 3rd party sources. Google "LAME MP3"
for an example of a free MP3 codec.
You may find other open-source MP3 projects that have code that
is simpler to use than ACM.
You could also study MP3 compression and write your own codec code.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
.NET has a function called String.PadRight. how can i duplicate this in win32?
thanks in advance,
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Something like this maybe (not tested!)...
LPTSTR MyPadRight(LPCTSTR pSrcStr, int nNewLen, TCHAR padchar)
{
int nNewStrLen = max(_tcslen(pSrcStr) + 1, nNewLen + 1);
TCHAR *pNewStr = new TCHAR[nNewStrLen];
_tcscpy(pNewStr, pSrcStr)
for (int i = _tcslen(pSrcStr); i < nNewStrLen - 1; ++i)
pNewStr[i] = padchar;
pNewStr[nNewStrLen - 1] = _T('\0');
return pNewStr;
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey Mark, Thank you for the reply. I set up a similar function to the one you posted but for some reason when i pass the integer looks as if it isn't even initialized. I am passing 15 as the value but when i check it in the debugger it is 13045942 . What can i be doing wrong?
the signature for the function is like this:
static char* PadRight(int nCharsToPad, char *strToPad, char chPadValue);
and i'm calling it like this:
StringHelper::PadRight(15, "padMe", '0');
Thanks again,
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
teejayem wrote: I am passing 15 as the value but when i check it in the debugger it is 13045942
I don't know why that would happen.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
its wierd. everytime it is a different value. if i pass 15 it shows 1314822 in the debugger if i pass 10 it shows 13438982. I'll keep searching, mabye i might find something if i do i'll post it here.
Thanks Mark
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Without seeing your implementation, I have no idea.
How and where in the code are you checking the value?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
below is what i have for the header file. Also, i uploaded a Screenshot[^] of the implementation. i know the padright isn't correct yet but i haven't been able to test it correctly. how i am checking it is by breaking into the debugger and mouseovering the nCharsToPad. Now that i look at it furthur none of the parameters are right. The screenshot shows the values in the watch window.
namespace Server {
class StringHelper {
public:
static char* PadRight(int nCharsToPad, char *strToPad, char chPadValue);
};
}
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
That error looks like a corrupted stack to me. I would check locally declared vars (especially arrays) in the function calling your StringHelper
|
|
|
|
|
i think found out what it was (thanks to the help of you two). When i compiled it in 'release' it was messing all of the variables up when i would check them in the debugger But in debug it would look fine. At that point i knew it would have to of been something in my project settings so i went through and compared everything between 'debug' and 'release'. The culprit is in C/C++ -> Optimization -> Optimization. It was set on 'Maximize Speed (/O2)'. when i set it to 'Disabled /Od' everything looked fine. It seems like the program still works fine when the compiler is set to /O2 you just wont be able to see your variables while your debugging.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Also be careful - if your string needs to be NULL-terminated and you're not using
an ASCIIZ as a pad character...
your function doesn't NULL-terminate the string.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|