|
I've got a quick question regarding the intellisense available from Visual Studio 2005 in my "native C++ static lib" project.
I've rearranged a lot of classes and yet the intellisense is way off. How to I force it to rebuild intellisense properly? The progress bar "updates" intellisense every so often but is now totally off.
Is there a file I can delete? Is there a menu item to mash?
Thanks!
-Chris
|
|
|
|
|
Yikes!
It's the same old .ncb file that we were used to in Visual C++ 6. Sweet I just deleted it and *boom* it rebuilt properly.
Sorry for what was most likely a re-post (it's been a long day already)
|
|
|
|
|
I am having trouble converting a CString variable to a char* variable below:
CString hello("CString");
char* hello1=new char[hello.GetLength()+1];
_tcscpy(hello1, hello);
Error 1 error C2664: 'wcscpy' : cannot convert parameter 1 from 'char *' to 'wchar_t *' d:\projects\c++.net\test3\test3
Why it is wrong?
Thanks in advance.
-- modified at 15:54 Thursday 9th March, 2006
|
|
|
|
|
yellowine wrote: char* hello1=new char[hello.GetLength()+1];
Change to wchar_t .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I use the char* hello1 for an OpenGL function which take strictly a char* parameter. and s wchar_t variable will not work for the gl function.
|
|
|
|
|
But does the use of wchar_t get rid of the C2664 error? There are ways to convert between Ansi and Unicode.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Unicode is turned on by default in 2005, so CString is a Unicode string, and _tcscpy is the wide string copy.
1) Use CStringA instead of CString
2) Use strcpy instead of _tcscpy
CStringA hello("CString");
char* hello1=new char[hello.GetLength()+1];
strcpy(hello1, hello);
"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
|
|
|
|
|
Dear yellowine,
If you need to convert a CString to ASCII in a unicode environment, there are several converting macros and functions available. Outof them, one of the easy to use is ATL conversion macro. Please see the code block below.
#include "ATLBASE.H"<br />
.<br />
.<br />
.<br />
<br />
CString csString( L"Hello" );
USES_CONVERSION;
char* pszTemp = W2A( csString );
<br />
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
Easy way to convert CString to char*
CString str="JAYARAJ";
char *ch= str.GetBuffer(str.GetLength());
JAYARAJ
|
|
|
|
|
J5121982 wrote: Easy way to convert CString to char*
Which won't work for the case in the question. You'll get the same error that yellowine did.
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"
|
|
|
|
|
As per my understanding, the discuession topic is conversion of CString to char* in unicode envrionment( as UNICODE is default in Visual C++ .NET 2005 from previous posts). Whether this code block will work in a UNICODE defined project? i have tested the same in VS 6.0. But its showing compilation errors.
or is this work only with Visual C++ .NET 2005 ? please clarify. I have no experiance with Visual C++ .NET 2005.
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
try this,
CString hello("CString");
char* hello1=new char[hello.GetLength()+1];
hello1 = hello.GetBuffer(hello.GetLength());
Have A Nice Day!
Murali.M
|
|
|
|
|
Hi,
I have a code in VC++ that takes user input values and gives the output. I need to copy all my user inputs and outputs after I execute the code. Dos based window is very small and shows only last part of the output. Is there any way in which I can get this output in a scrolling window background? I tried using quickwin version 1.0 but it only accepts user input and stops after all my inputs are over. It does not display any output at all.
Please help me out with this problem. Appreciate your time and efforts.
Thanks,
Ashu
|
|
|
|
|
APOTDAR wrote: I have a code in VC++...
Is this a console application or a GUI application?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
This is a console applicaiton.
|
|
|
|
|
As I've never tried it, this is just a guess. I don't think your application will be able to get information about the console window in which it is running. I think you'll need to create another console application that does nothing but call CreateProcess() and redirects the stdin/stdout handles of the child process. See here and here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Dear Ashu,
Increasing the Console Screen buffer may solve your problem. please see the code block below. Please insert this code block at the starting of your program.
#include "Afx.h"
<br />
HANDLE hConsoleOutput = GetStdHandle( STD_OUTPUT_HANDLE );<br />
<br />
COORD stScreenBufferSize;<br />
stScreenBufferSize.X = 300;
stScreenBufferSize.Y = 1000;
<br />
SetConsoleScreenBufferSize( hConsoleOutput,<br />
stScreenBufferSize );
At the end of the program, please add some getch() function which waits for user input and then, take the console window and copy your required data from there.
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
-- modified at 21:38 Thursday 9th March, 2006
|
|
|
|
|
Hi,
I trying to search a silence in MP3 File.
I don´t now how I can make that.
I using the Direct X and Visual C++.
Do you have any idea to help me??
Thks!!!!!
|
|
|
|
|
You would have to decode the MP3 and then look at the resulting waveform for peaks above a certain level.
The tigress is here
|
|
|
|
|
I am just checking out sample code on MSDN as see below, i have created a basic MFC app using the wizard and copying the code below into it and made a few changes for it to run.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/example__getting_wmi_data_from_the_local_computer.asp
in the code "CredUIPromptForCredentials" is called but a dialog doesnt pop up when run.
there is a line of code "cui.hwndParent = NULL;" should that not point to a parent window, how do i point it to a parent window, is it using HWND somehow?
thx
|
|
|
|
|
Can you give a specific of code form your project.
If you want to assign the parent window, please assign the handle of the main window. But I can be more helpful if you can give sepcific of your code
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
We currently determine if a process is running on the local system by openeing the performance data and scanning the 'process' performance data, searching for the name of the EXE in the performance data. There is some overhead with the various registry-function calls, allocating memory, traversing memory, string compare, etc.
Otherwise, you can call EnumProcesses, which then involves OpenProcess and then GetModuleFileName and searhcing the string.
Has anyone else made such a conversion fromt he registry data to EnumProcesses and then regretted such a change because of performance loss, security issues, or otherwise?
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
i developed a program before to monitor processes, but i can not remomber exact code.
the idea is:
1. use EnumProcess() to find all processes
(there are a few of examples in VC samples)
2. Set a Timer to check changes every 2 seconds.
It may not be what u need.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Thank you for your reply.
I have done what you suggested in other projects as well, and have a fairly substantial class for enumerating the processes already.
However, I am just wondering (without profiling the two techniques myself myself) which of the two techniques I briefly discussed is faster.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Hello,
am still having a problem with this appending. Am recieving data from a machine two times(i,e total lenght of recieving bytes:212) but am recieving them as length:x1 and length:x2)spliting into two chunks.
count:1 //first chunk of data
length:112//length si varying, not constant, say x1
0x65 0x66 0x67......
count:2// second chunk of data
length:100//length si varying, not constant, say x2
0x23 0x40 0x46 0xcf....
How could i append the length of x2 bytes to x1, so that i should have total 212 bytes.
i would be gald if anyone halps me out from this.
BYTE buffer[1024];
BYTE array[1024];//the output data am recieving from machine is in buffer
for(i=0;i<=lLength;i++)
printf("#%x", buffer[i]);
if(count>1)
array[i]=buffer[i];//am assigning all the buffer values to array if count is greater than 1.
"or" i can use memcpy() also, but there si no result;
is it correct?? but i couldnt get append the whole data? could anyone plz help me for appending
-- modified at 12:10 Thursday 9th March, 2006
|
|
|
|