|
Parallel port access u can use the traditional outport & inport functions
but if u want to deal with the device driver concept the u need to search
for it .Probably there are few available class on the internet wich serves
ur purpose.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hello to all the weekend programmers in the house ::- ) (since it's Sunday 2 AM right now...). Is there any night-bird (or morning bird if we're at it...) able to tell me how can I retrieve such regional settings from the Windows OS like UTC Hour Difference and Week Day Name? I know it MUST be possible somehow but I searched a bit and didn't find anything relevant.
APIs such as GetSystemMetrics or SystemParametersInfo don't seem to be of any help (or am did I miss something?). So GetSystemTime returns the time in UTC format. How can I convert it to the format that the local Windows user uses?? What about the week day name? In English it's Sunday but if the user uses a French regional package it would be Dimanche (I hope I didn't mess up the spelling). Soooooooooo?
Edit 1: Stuff like CIMV2 is not good 'cause it only works on NT.
Edit 2: I found how to get the UTC time difference. Here's the answer: GetTimeZoneInformation API. Now what about the day of the week name in the regional language of the user. The Operating System has usually has them. Anybody know anything about how to get it?? ::- ).
-= E C H Y S T T A S =-
The Greater Mind Balance
-- modified at 3:52 Sunday 13th November, 2005
|
|
|
|
|
If you just need the local time, you can call GetLocalTime() , which automatically adjusts the UTC for the difference, Daylight Savings Time, and so on.
You can use GetDateFormat() to format dates according to the user's language and localization.
Software Zen: delete this;
|
|
|
|
|
I found that already. Didn't know about GetDateFormat ::- > and it's very useful to. Thanks!
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Hey,
how can I create a (toplevel) window - derived from CWnd - in my SDI - application. I need a window which can be plased outside my application window. I created a class "CHelpWindow" derived from CWnd. After that, I wanted to create this window in my CMainFrame class, but not as a childwindow!
Here is my first try:
m_hHelpWindow.CreateEx(NULL, NULL,"TestWindow",WS_CAPTION,reRect,0,IDW_TEST,0);
-->CreateEx fails...
I like to have a window with border, sysmenu and caption...
Thanks for your advice...
|
|
|
|
|
|
I'll try this..
Is it possible to create a window derived from CScrollView?
|
|
|
|
|
Hi,
I am trying to draw Ascending and Descending sort arrows in a ListView Control Header using the WIN32 API. I have handled the NM_CUSTOMDRAW message and everything works ok except for one situation. The first time I click on the header control the column data is sorted properly, but the sort arrow is drawn then immediately erased. If I swap to another window and come back the sort arrow appears in the display. If I click on the same column a second time the arrow is drawn and remains in the display. The problem occurs anytime I click on a column in the header for the first time.
I know there is something I am missing here but being new to WIN32 I don't have a clue what else to try.
Thanks!
|
|
|
|
|
How about doing it with a bitmap instead, so you don't have to worry about drawing the arrow yourself? Check the docs on HDITEM - there's a mask flag HDI_BITMAP and you store a bitmap in the hbm member. If you're on XP+, the header has built-in sorting arrow support - see the HDF_SORTDOWN and HDF_SORTUP flags.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
Come quietly or there will be... trouble.
|
|
|
|
|
Gentlefolk:
Has anyone out there done thid kind of thing?
I have been overloading "operator new" to create variable sized classes. I need to create millions of instances of these classes to be processed very rapidly and believe this technique avoids one allocation of data on the heap each invocation.
It seems to work pretty well, but ocassionally leaves stuff on the stack when I believe it has been deleted. I suspect this results when C++ creates temporaries when interpreting complicated statements, and may involve using this for a derived class. I have been not able to pin down exactly the what situation causes this.
I've tried to support "DEBUG_NEW" and that adds to the confusion.
Any help will be appreciated.
The following gives you the gist of what I'm doing.
class MyBase
{ public:
// whatever
};
class MyDerived : public MyBase
{ public:
// whatever
byte m_Data[];
MyDerived( const int &a_Size = *( int * )NULL )
{ memset( &m_Data, '\x00', a_Size ); }
virtual ~MyDerived() {}
#if !defined _DEBUG
void *operator new( size_t a_BaseSize, size_t a_AppendSize )
{ void *t_Memory = malloc( a_BaseSize + a_AppendSize ); return t_Memory; }
void operator delete( void *a_Memory )
{ free( a_Memory ); }
void operator delete( void *a_Memory, size_t a_AppendSize )
{ free( a_Memory ); }
#else
#undef new
void *operator new( size_t a_BaseSize, size_t a_AppendSize, LPCSTR a_File, int a_Line )
{ void *t_Memory = _malloc_dbg( a_BaseSize + a_AppendSize, _NORMAL_BLOCK, a_File, a_Line );
return t_Memory; }
void operator delete( void *a_Memory )
{ _free_dbg( a_Memory, _NORMAL_BLOCK ); }
void operator delete( void *a_Memory, size_t a_AppendSize, LPCSTR a_File, int a_Line )
{ _ASSERTE( false ); _free_dbg( a_Memory, _NORMAL_BLOCK ); }
#define new DEBUG_NEW
#endif
};
//MyProgram
...
int size = 100;
#if !defined _DEBUG
MyDerived &NewDerived = *new( size ) MyDerived( size );
#else
#undef new
MyDerived &NewDerived = *new( size , THIS_FILE, __LINE__ ) MyDerived( size );
#define new DEBUG_NEW
#endif
...
-Obi Wan 2
|
|
|
|
|
Hello,
Since you overloaded operator new, do you allow instances to be created in an other way? For example, did you make the constructors private?
I also see that operator new is global and not a member of your class. It should be a member of your class. See here[^] for more details.
Hope this helps
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob:
Thanks...
The reference you send is helpful.
In actuality (not clear in my example), the new and delete overloads are not global. They are within the class definition brackets.
The constructors have not been declared private. It is unclear to me why this would be necessary or useful.
The example in the reference says that the source line "new( 'user_args' )" is expanded to "new( 'type_size', 'user_args' )", which seems to be the case. In that case, 'type_size' is the total object size; in my case, 'type_size' is the class size without any appended data and 'user_args' is the additional allocation. The problem is that the actual size of the class is 'type_size' + 'user_args'. I'm not sure how the compiler would know how to create a temporary object, being unaware of the total size.
-Obi Wan 2
|
|
|
|
|
Obi Wan 2 wrote: The constructors have not been declared private. It is unclear to me why this would be necessary or useful.
This is to protect other users of your class to mess up your memory allocation strategy. For example by deleting a pointer to a class on the stack or whatever. Makes your class a bit more dummy proof. When doing this, the compiler also has a hard time creating temporary objects..
Obi Wan 2 wrote: The problem is that the actual size of the class is 'type_size' + 'user_args'. I'm not sure how the compiler would know how to create a temporary object, being unaware of the total size.
You'll have to look at the generated assembly for that. You'll discover the problem there.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Using VC6
Solution must be compatible with Win98 and higher (can't use WH_KEYBOARD_LL for the hook)
----------------------
I've tried creating a global keyboard hook so that I can intercept keystrokes in a given application. However, it's not capturing every key combination. I can get X, Ctrl-X, or Alt-X, but not Ctrl-Alt-X.
Can anyone provide any insight?
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
That's the first article i looked at. I get the same results.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
What OS? I just tried the demo and I got the Ctrl + Alt + X message.
"When you know you're going to eat crow, it's best to eat it while it's still warm." - Reader's Digest
|
|
|
|
|
On Win98, if you create both a hook and a hotkey for a given key combination then the hotkey wins in front of the hook event.
So, check your hot keys
Maybe this helps.
SkyWalker
-- modified at 15:14 Saturday 12th November, 2005
|
|
|
|
|
Deleted the accelerators before I tried it.
Maybe I missed something, I'll try it again...
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
delete and then restart
SkyWalker
|
|
|
|
|
Just a guess, but is your system set to a language other than English? Some languages such as German have another shift key called AltGr, and if the keyboard doesn't have an AltGr key, Windows lets you use Ctrl+Alt instead to get in the AltGr shift state.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
Shots do not hurt other players... yet
|
|
|
|
|
Has any1 developed any kind of software capturing data from TV Tuner through AVICap window class. I need some help on it. I shall be very thankful to him/her.
|
|
|
|
|
Sir Khan...
Checkout the windows 98 and or XP Driver Development Kits.... search msdn.microsoft.com for Win98 DDK or WinXP DDK.... In the sample code you will find a project that is pretty much exactlly what your looking for... Infact, I once used this code to create a sort of TiVo ripoff a while back ago....
I know what your trying to do isn't really related to drivers, but there is an example there... The whole DDK thing is a pretty steep learning curve... well at least for me
-peace out yo
-dB0
|
|
|
|
|
I remember that a sample is called avicap. You may search it in MSDN.
|
|
|
|
|
I HAVE downloaded a important project file which has few
*.c and *.h files and other file as *.vcp(VCPROJ) do anyone
know what type of file is this and is it related to any MVStudio.
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|