|
The "T" doesn't mean Unicode. A TCHAR can be either char or wchar_t depending on if your building a Unicode build or not. It depends on the UNICODE , _UNICODE and _MBCS preprocessor definitions.
Steve
|
|
|
|
|
it doesn't mean unicode,, but it's still there for it
|
|
|
|
|
|
OK, I have read just about every printing example I can find and I still cannot find a way to do this.
In my app, non-MFC, I have a listview containing quite a bit of data. I need to be able to print this data as a table. Printing lines of text and bitmaps is no problem, but when it comes to trying to structure this data it's getting a little confusing.
The table itself will never change, only the text and cell data. So It's no problem to create a template stored in the resources to which I can simply add cell values. But what sort of file should I create that can easily be populated and printed?
Please somebody kick me towards the right link.
|
|
|
|
|
Check out the Printing section on the left menu.
http://www.codeproject.com/printing/printlib.asp[^]
This article has a sample of defining printing tables.
He was a snowflake, like other "unique" snowflakes, falling down, getting stepped on, and pushed aside to disappear.
|
|
|
|
|
Hi all,
I have already a standad Visual C++ . NET, version from year 2003.
And, with this Visual C++ . NET [ version 2003], is it necessary to download VC++ Express Edition 2005?
Also, is it fully compatible with SDK plateforme + DirectX 9 installad from February 2006?
And, with this Visual C++ . NET [ version 2003], y is it necessary to download VC++ Express Edition 2005?
Thanks a lot
Regards!
|
|
|
|
|
Visual C++ .NET 2003 and Visual C++ 2005 are two (almost) completely different languages. the 2005 version cleans the syntax up A LOT and is called C++/CLI. The express edition should be compatible with any recent SDK's. I recommend downloading 2005 since it's free, and it makes it a lot easier to target the .NET platform
Thanks,
John
|
|
|
|
|
thanks a lot,
So...
I was hesitating as I earlier kept the Visual C++.Net.
In fact up to this month, Visual C++ 6.0 was offering the advantage to provide a lot of tips..etc.. as well as books, references.
Instaed than VC++.Net stayed almost without publication and not so much referenced.
So,as an expert, your advice would be to jump on Visual C++ Express Edition 2005 [ even if beta version] and programming with C++ is fine. However, programming Windows changes a lot, requires SDK and Direct X 9 are a plus .
And this is the end of VC++ 6 ( a pity honestly if we consider the difficulties to convert from VC++ 6)
thanks a lot
Regards
TPP
|
|
|
|
|
Why can I cast a pointer to a static non-class function to DWORD (for example), but not a pointer to a non-static class function? (The compiler generates an error if you try)
ie:
DWORD dw1 = (DWORD)fnStaticGlobalFunc; // OK
DWORD dw2 = (DWORD)pMyClass->fnClassLocalFunc; // Error
|
|
|
|
|
Martijn van Kleef wrote: The compiler generates an error if you try
and what does it say ?
|
|
|
|
|
Sorry, didn't include it because this:
c:\Documents and Settings\Martijnv\My Documents\Visual Studio Projects\TestWin32Console\TestWin32Console\TestWin32Console.cpp(193) : error C2440: 'type cast' : cannot convert from 'void (__thiscall X::* )(void)' to 'DWORD'
There is no context in which this conversion is possible
...still doesn't tell me why I CAN cast the static global function to DWORD but CANNOT cast the non-static class member function.
|
|
|
|
|
Notice the __thiscall X:: part of the type - that means the function is a member of class X and takes a X* parameter (which becomes this in the method). You can't cast that away.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
For non class functions, the compiler knows exactly where the function resides.
For class members it doesn't.
class base {
public: virtual void fn() {}
};
class derrived {
public: virtual void fn() {}
};
base *p = new derrived;
DWORD dw = (DWORD)p->fn; // which fn??
|
|
|
|
|
that's false. a member function is not duplicate for each instances of the class. the member functions bodies are loaded once in memory. only the implicit this parameter differs depending who call it.
|
|
|
|
|
C++ refuses to 'throw away' the class association of the non-static class method, which is what is happening in the example you give with the class method. The compiler basically says, "If I lose the class association for this method, I won't be able to tie this method back to an instance of the class."
It's not an issue with the a global (i.e. non-class ) function because there is no class association. It's also not a problem with a static class method. Static class methods aren't much more than global functions that are 'hidden' inside a class namespace. They don't have an instance of the class associated with them when they are invoked.
If you really, really, really need to get the value as a DWORD, you can use a union to get there.
<br />
class CSomeClass<br />
{<br />
public:<br />
void SomeMethod();<br />
};<br />
<br />
union<br />
{<br />
DWORD dwValue;<br />
void (CSomeClass::*pMethod)();<br />
} Address;<br />
<br />
<br />
Address.pMethod = pSomeClass->SomeMethod;<br />
<br />
<br />
Note that this technique is not implementation independent! Run on a machine that uses pointers that are not 32-bits and you have a problem.
Regards,
Dan
Remember kids, we're trained professionals. Don't try this at home!
|
|
|
|
|
Actually that won't work..
If I use the union solution posted previously my compiler (Visual Studio .NET 2003) complains:
error C2475: 'CSomeClass::SomeMethod' : forming a pointer-to-member requires explicit use of the address-of operator ('&') and a qualified name
An implementation according to the suggestion of the compiler seems to work though:
Address.pMethod = &CSomeClass::SomeMethod;
But now, where on earth did all the fuss about the this pointer go?? Did I just seem to have discarded it??
|
|
|
|
|
Well, look at that - another syntax / semantics change from VC++ 6 to 2003/2005. Grumble, grumble, grumble... But yes, I just tried the variation you describe under 2005 and it does the trick.
Anyway, it's not that you are discarding a specific 'this' pointer. The issue is that you are not discarding the class association.
If you try to cast &CSomeClass::SomeMethod to something else such as:
DWORD dw = (DWORD) &CSomeClass::SomeMethod;
the compiler will still complain because this conversion would force it to discard the class association. (Actual error message under 2005 says,"There is no context in which this conversion is possible")
Dan
Remember kids, we're trained professionals. Don't try this at home!
|
|
|
|
|
Hello friends, has anybody knowledge about creating virtual serial ports, because I must write a program which can create virtual serial ports and be able to monitor the communication on these virtual serial ports.
Thank you for your help in advance!
szilard
-- modified at 8:40 Thursday 16th March, 2006
|
|
|
|
|
|
Like the title says, I want to add some printing functions to my code, a NON-MFC windows app, without having a printer installed on my system. Oh what a crazy world we live in.
Is there some way to fool my PC into thinking there is a printer installed? Every time I try to call one of the Common Dialog print routines I am faced with a "Please install a printer you cheap artist" message.
Hey I do all my printing at work, what do I wanna go and spend a few hundred bucks on a printer I will never use for?
|
|
|
|
|
Pdf995 Printer Driver
It works like a printer, only it sends output to a .pdf file. It has an annoying ad in it though - there's another free pdf writer available without ads, but I can't remember the name of it. (cutepdf?)
"My dog worries about the economy. Alpo is up to 99 cents a can. That's almost seven dollars in dog money" - Wacky humour found in a business magazine
|
|
|
|
|
Thanks for the tip, I never thought of using a print to pdf driver.
Having a little trouble with the pdf995 website, but I am downloading the cutepdf alternative you mentioned.
|
|
|
|
|
You can install a printer without actually having the printer. I've done it lots of times. Just tell it to print to a file instead of a port.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
I tried to create a process(notepad.exe) using the CreateProcess method. But the method failes throwing a Exception.
Could any one please tell why this following code snippet is failing.
PROCESS_INFORMATION pProcessInfo;
BOOL bStatus = CreateProcess("C:\\WINDOWS\\Notepad.exe",NULL,NULL,NULL,NULL,CREATE_NEW_CONSOLE,NULL,NULL,NULL,&pProcessInfo);
Regards
|
|
|
|
|
PROCESS_INFORMATION pProcessInfo;
STARTUPINFO si= {0};
si.cb = sizeof(STARTUPINFO);
BOOL bStatus = CreateProcess("c:\\WINDOWS\\Notepad.exe",NULL,NULL,NULL,NULL,CREATE_NEW_CONSOLE,NULL,NULL,&si,&pProcessInfo);
|
|
|
|