|
How do you know that it is a tab character (I mean in what editor does the char be displayed as a tab?) ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
check for ^I for tab space (if any tab is present)
never say die
|
|
|
|
|
To my knowledge, edit controls do not support tab characters. I suggest that you replace each tab character encountered with an appropriate number of spaces.
Another idea would be to use a rich edit control.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi
I have been doing a bit of work with 'wav' files, and in the format the number of channles can be defined. I have only found mono\stereo files so far - is it possible to have 4 channel 'wav' files (quadraphonic)?
Even better would be 5.1 surround sound (or are the extra (Centre & Bass)channels derived from the L\R mix?)
If it is possible, can anyone point me in the right direction to get a sample 4 channel 'wav' file so I can have a play?
Sorry - probably not the right place to ask this, but not sure where to
Regards
69 Bay
-- modified at 6:36 Wednesday 16th August, 2006
|
|
|
|
|
Hi All,
When we include a class, the wizard creates two files (.h and .cpp) in the class's name. The .cpp file starts with like this:
#ifndef _FILE1_H
#define _FILE1_H
#include "File1.h"
#endif
Hope this is a way to avoid including the file (.h) more than once in the application. How this .cpp file is getting related with its corresponding .h file? Because, we include only .h file.
Kindly let me know that how can compare this with "# pragma once" and more about "pragma".
Thanks in advance,
Sarvan AL
*** Live Life To Its Fullest ***
|
|
|
|
|
Sarvan AL wrote: Hope this is a way to avoid including the file (.h) more than once in the application
Yes, it is. However, the #ifdef/#define##endif should normally be located inside File1.h, and not where it is called.
In File1.h:
#ifndef _FILE1_H
#define _FILE1_H
.. here the declarations
#endif
In the .cpp
#include "File1.h"
Otherwise, you need to reproduce the ifndef/endif block for each include of the File1.h, which is no good practice (unless you have some hardware limitation, like the h file is located on some network that is lengthy to be accessed and that the simple fact of going inside the include lasts 5 seconds or more).
#pragma are directive to the precompiler, e.g. the software that runs one time through the code before the compiler. It replaces all occurences of #defines with their real value, copies the content of includes inside the cpp file, etc..
The precompiler can be given some directives using #pragma, such as #pragma disable(warning:1020) which disables warning 1020. Meaning and sometimes existence of pragmas depends on the compiler.
#pragma once is a directive that (for visual c++, but also other compiler) says that the file in which it is located must only be included once. It is equivalent to the code block I've provided you with.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Hi Rage,
Thank you for your detailed explanation.
Sarvan AL
*** Live Lift To Its Fullest ***
|
|
|
|
|
Adding to Rage explanation on #pragma once, the header file is scanned only once(internally it is maintained in a table)where as
Rage wrote: #ifndef _FILE1_H
#define _FILE1_H
.. here the declarations
#endif
if the header file is included more than once in a .cpp file,it is scanned that no times
-- modified at 8:04 Wednesday 16th August, 2006
-- modified at 8:05 Wednesday 16th August, 2006
never say die
|
|
|
|
|
Hi all,
For some reason my project does not kick in the compiler when I make changes to the code during debug. It used to be fine on VC++ 6, I recently moved the project to VC++ 8.
Has anyone else experienced this? I checked all the debug settings (both in project and IDE), nothing seems to make any difference. New projects allow me to debug with edit and continue fine.
Any suggestions are more than welcome.
All the best,
Tony.
|
|
|
|
|
I have created a class with the following defined:
friend CStrTemp& operator += ( CStrTemp& i, const CStrTemp& s );
and then:
template<class t=""> CStrTemp<t>& operator += ( CStrTemp<t>& i, const CStrTemp<t>& s ) {
///code and return
}
Everything compiled but when it tries to create the executable it throws up the followinf error:
CString.obj : error LNK2019: unresolved external symbol "class CStrTemp<char> & __cdecl operator+=(class CStrTemp<char> &,class CStrTemp<char> const &)" (??Y@YAAAV?$CStrTemp@D@@AAV0@ABV0@@Z) referenced in function "class CString __cdecl operator+(char,class CString const &)" (??H@YA?AVCString@@DABV0@@Z)
Any help would be appreciated as I just cannot understand why it is not working.
|
|
|
|
|
What is CStrTemp ? Is it derived from something ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
ajisthekingofpop wrote: unresolved external symbol...referenced in function "class CString __cdecl operator+(
What does the operator+ method look like?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
There are a few problems here.
First, depending on your compiler, some versions of MFC's CString have a hidden class called CStrTemp. Thus, defining your own class with the same name can cause problems (one of the reasons MFC should have put its stuff in a namespace, and the reason you should do the same).
Second, you defined the function as: friend CStrTemp& operator += ( CStrTemp& i, const CStrTemp& s ); , but implemented it as template CStrTemp& operator += ( CStrTemp& i, const CStrTemp& s ) (I'm assuming you just mistyped the <> signs and that the template declaration should actually read template<class T>). If you defined the class as a template, that will work, but you will need to declare it similar to the following:
friend CStrTemp<T> operator+=(CStrTemp<T>& i, const CStrTemp<T>& s)
and implement it as
template<class T><br />
CStrTemp<T>& operator+=(CStrTemp<T>& i, const CStrTemp<T>& s) {...}
Put your code in a namespace and fix your template declarations and this should clear some things up.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Zac Howland wrote: some versions of MFC's CString have a hidden class called CStrTemp
Now this is interesting. Thanks for sharing it.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
hello all
I am searching for MFC XP Explorer Bar like.
I found an OCX control called vbAccelerator Explorer Bar Control
I tried to use this control inside my MFC application but visual studio 2003 didn't extracted all the required interfaces to deal with the control.
I added the control to the project by adding new class from activeX control.
I would like to know how to add this OCX to my MFC project right
your help is so much appreciated
Hesham
|
|
|
|
|
Hi,
does anyone knows how to or if it is possible to realize an offline DRM?
I mean I would like to give someone the file with limited permission to playback or copy,
but he has limited access to the internet so he isn't always able to connect to license server.
I want to give him the opportunity to use the file even if he is offline, but also keep the file rights(so if he has permission to play for 1 time, he won't be able to play it more then 1 time ).
PS Sorry if this board isn't appropriate for this kind of question.....
|
|
|
|
|
|
Hello;
in order to get full description of an event located in eventViewer
i used ReadEvetLog to obtain event id and source name ;
i can after read the dll which contains the message description
example for security center is xpsp2res.dll ;
1. i used load library to load the file
2. i used findRessource to find message N° 1800
the second operation fils always ;
i don't know why???
CODE
HMODULE handle;
HANDLE Res;
DWORD dwLongBuff;
char Buffer[MAX_BUFFER_SIZE];
va_list list[10];
handle=LoadLibrary("c:\\windows\\system32\\xpsp2res.dll");
if (handle==NULL) printf("failure to load"); else printf ("loading ok");
HRSRC hrsrc=FindResource(handle,"#1800",RT_MESSAGETABLE);
if (hrsrc==NULL) printf("failure to load2"); else printf ("loading ok2");
dwLongBuff=FormatMessage(FORMAT_MESSAGE_FROM_HMODULE,handle,
1036,4,Buffer,MAX_BUFFER_SIZE,list);
|
|
|
|
|
fx9200 wrote: the second operation fils always
Does FindResource or FormatMessage fail ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Hi Guys,
Can anyone pls tell me how to convert char to unsigned char unstr[1000];
i am trying to do the following,
strcpy(unstr,(unsigned char *)"TESTING");
But i get an comilation error : cannot convert parameter 1 from 'unsigned char [100]' to 'char *'
Pls kindly adivse me
Thanks
Cheers )
Thank you guys.....
Tuscon.....
|
|
|
|
|
strcpy((char *)unstr,"TESTING");
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
_mbsncpy ?
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
You can also use memcpy instead of strcpy .
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
hi all i want to implement windows hooks in service.i had implemented the hooks at the standard application(as DLL) it works fine.but the problem is that it did not worked for the service. i mean callback function is not called when service executed.
tell me what i do. any help is welcomed.
Tasleem Arif
|
|
|
|
|
Nt services are running in a difrent window station and desktop called -Service0x0-3e7$\default . All our applications are under Winsta0\default . So there may not be any applications running with an associated window object to invoke the hooked WindoProc.
Try by changing the service type to SERVICE_INTERACTIVE_PROCESS so that the service will run under Winsta0\default desktop.
cheers...Milton KB
|
|
|
|