|
suhredayan® wrote:
I feel its a valid call. But gives an error coz CString::Format() returns void.
You're absolutely correct. My bad .
The following does indeed compile, though how it could be used in a useful way is still a puzzle. (since it cannot be assigned to anything)
void MyFunction()
{
CString("Hey").Format("There!");
}
I Dream of Absolute Zero
|
|
|
|
|
That compiles *and* runs successfully.
The problem is that CString::Format 's return type is void . So that's the return type of this statement, and there doesn't seem to be any way to convert that to the LPCTSTR that AfxMessageBox expects.
It's going to take some serious obfuscation to make this work. My question is...what's wrong with a local CString variable? Like it or not, the statement itself is creating a local CString that goes out of scope after the statement executes.
Bob Ciora
|
|
|
|
|
Bob Ciora wrote:
It's going to take some serious obfuscation to make this work. My question is...what's wrong with a local CString variable? Like it or not, the statement itself is creating a local CString that goes out of scope after the statement executes.
Its all about trying to show the geekness, wot you feel cing the following.
int fun(tchar* buff,tchar* szFnd,int n)
{
....
....
return CString(buff).Right(n).Find(szFnd);
}
suhredayan There is no spoon.
|
|
|
|
|
Although this is a valid call, isn't it a bit like asking for "unpredictable results" to come your way ?
CString strText( _T("Hey") );
strText += _T(" there !"); Much easier, much simpler, and compiles correctly
-Antti Keskinen
----------------------------------------------
"If we wrote a report stating we saw a jet fighter with a howitzer, who's going to believe us ?"
-- R.A.F. pilot quote on seeing a Me 262 armed with a 50mm Mauser cannon.
|
|
|
|
|
Dear all,
I am doing a project named Distributed Compiler. For that i need the file format that NMAKE utitlity is producing.
Do anyone know links or articles describing the NMAKE file format ? if any, please let me know.
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
float f(12.34);
CString s;
s.Format("%.5f",f);
>>12.34000
but how to format string to be 00012.34000
|
|
|
|
|
float f(12.34);
CString s;
s.Format("%011.5f",f);
>> 00012.34000
Steve
|
|
|
|
|
plz tell me. how i can use ADO with SQL database in MFC Dialge.
thanx
Syed Abdul Qavi
|
|
|
|
|
Check the classes CDatabase and CDaoDatabase.
May be i am wrong but i hope these will give you clue
Regards.
|
|
|
|
|
CDatabase uses ODBC, and CDaoDatabase uses DAO. To use ADO requires importing from the type library (e.g., msado##.dll).
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
|
Hi,
I have a problem in Installshield ,
I am adding shortcuts in Rsources->shellObjects->Desktop->Start Menu->Programs-> Application Folder ->( Shortcut)
But these shortcuts are not appearing after installing the Application .
Can you tell me solution
thanx
Regards.
|
|
|
|
|
I think it will solve ur problem.
Rsources->ShellObjects->Explorer Shell->Desktop->Start Menu->Programs-> Ur Application ->Shortcut
|
|
|
|
|
Can anyone please explain me what is a call back function?
Is that function an API or is it something else?
Thanks
Prem
|
|
|
|
|
|
Hello Experts,
I am using MsFlexGrid control in my DialogBox. How to add print functionality?
I have fixed 20 rows and 20 columns in my grid, and it scrolls when data exceeds.I wish to print all data.
Regards
Deepali
|
|
|
|
|
Hi,
From within my application i need to wait for an external process to complete before proceeding. But all i have is the external process's name. Is there any API that returns the process id or handle given the process name ?? I tried using CreateToolhelp32Snapshot but it does not seem to work in VC41 in which my application is built. It works fine in VC6 though.
Thanks for ur help.
|
|
|
|
|
You can not to get the Handle of the process from the process name, you need to do the contrary. You must to enum the process handles or Ids and the get the process name
You need to use the psapi.dll library.
You must to use the EnumProcessModules function and then the GetModuleFileNameEx function to get the filename of each process.
Regards
Carlos Antollini
Do you know piFive[^] ?
|
|
|
|
|
Thanks a lot. That works.
|
|
|
|
|
hi all,
i am facing a problem with the setwindowrgn ,It works fine on Winnt but in the case of WIN98/ME the function always RETURNS 0..which indicates that it is a failure.
can anyone suggest me anything regarding this .
thnx in advance .
regards
udaykumar
|
|
|
|
|
Can somebody tell me how to get all file path name in a specified folder? Thanks.
|
|
|
|
|
CString theFileNamePath;
CString extension("*.txt");
CString filePath("C://");
CString completeFilePath;
HANDLE handleToFind;
WIN32_FIND_DATA FindInfo;
WIN32_FIND_DATA *FindInfoPoint = &FindInfo;
completeFilePath.SetString(filePath+ extension);
handleToFind = FindFirstFile(completeFilePath,FindInfoPoint);
while(handleToFind != NULL)
{
theFileNamePath = completeFilePath+ FindInfo.cFileName;
//....SOMETHING....
if (FindNextFile(handleToFind,FindInfoPoint) == 0)
break;
}//while
FindClose(handleToFind);
hope that'll do
|
|
|
|
|
Hi MASTERs,
I am using CDC::TextOut() to display lines in the screen. Imagine that I want to display the following line:
1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789, [Put a double byte kanji character]
1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789, [Put a double byte kanji character]
1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,1234,6789,
If you run in Windows 2003 Japanese, you will see that the 3rd line is aligned properly on the screen but it is NOT aligned properly when you do printing or print preview (no matter which font you are using, the alignment always wrong).
Now, if I remove the comma, both printing and displaying works fine (aligned the line properly).
1234678912346789123467891234678912346789123467891234678912346789 [Put a double byte kanji character]
1234678912346789123467891234678912346789123467891234678912346789 [Put a double byte kanji character]
1234678912346789123467891234678912346789123467891234678912346789
It is only happening in Windows 2003 Japanese and Windows XP Japanese (I haven't check Chinese version yet, but I think it will have the same problem).
Any idea? Please help...
Thanks...
|
|
|
|
|
No one ever encounter this problem? Please help...
|
|
|
|