|
Rajesh R Subramanian wrote: if CString is already being used? Not to mention that you will need to explicitly link to shlwapi.lib! Roll eyes
good, talking like a real programmer. some time i think i am quite beginner in programming now
|
|
|
|
|
That feeling, I'm familiar with. We all have aplenty to learn.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
hi!
Since VOIP is prohibited within some area, broadband internet ISPs block VOIP ports or drop VOIP signal and voice packets,so i want to wrapp the VoIP trffic into a package which can not be detected by ISP.
So can any one please help what should i do for wrapping?
Which technology should I use?(may be SSL Tunneling or any other?)
Please help me.
thanx in advance
Note:May be this is not the right forum,but i dont know which technology or programing lang i should use)
|
|
|
|
|
this has to be done using vc++.
but i do not know how to do that..please help.
thanx in advance
|
|
|
|
|
hi,
i have the below code..
TCHAR buffer[SIZEOFTCHAR];
::GetSystemDirectory(buffer,SIZEOFTCHAR);
CString csPath;
csPath+=_T("");
i want to copy value in buffer to csPath and i want to append other string to csPath.Please let me know...
|
|
|
|
|
No need to convert anything, you can simply assign your buffer in your CString object:
CString csPath = buffer;
If you need to concatenate your buffer at the end of the CString content, you can also do it like this:
CString csPath = "Something";
csPath += buffer;
BTW, what is SIZEOFTCHAR ? What is its value ? If it is the size of one character, then your string will only be able to contain 1 single character, so I guess this is not really what you want.
|
|
|
|
|
Thanks for ur Reply.....
but the issueis...
TCHAR buffer[8000];
::GetSystemDirectory(buffer,8000);
i need add the below string to the path which is obtained from above function..
CString csPath;
csPath=_T("\\")+"files.ini";
Please help me..
|
|
|
|
|
p_1960 wrote: i need add the below string to the path which is obtained from above function..
CString csPath;
csPath=_T("\\")+"files.ini";
CString csPath = buffer;
csPath += _T("\\files.ini");
|
|
|
|
|
TCHAR buffer[8000];
if (! ::GetSystemDirectory(buffer,8000))
{
}
CString csPath(buffer);
csPath += _T("\\files.ini");
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
p_1960 wrote: TCHAR buffer[8000];
What's your fetish with the number 8000?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I make a guess:
This sample [^] uses 32767 , that is 0x8000-1 (Well..., actually the two things are probably unrelated...)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: This sample [^] uses 32767, that is 0x8000-1 (Well..., actually the two things are probably unrelated...)
thats probably best answer i ever got!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Thank you, anyway I guess you got too few answers in you life...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote:
Thank you, anyway I guess you got too few answers in you life
i thought you are taliking about question
|
|
|
|
|
Just kidding, pal (I know, I often forgot the joke icon... )
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CString is 16 bit under unicode but 8bit under non unicode version i guess.
but
so underunicode version direct conversion can be done as TCHAR is unsigned short.
where in non unicode version, WideCharToMultiByte() can be used
|
|
|
|
|
|
You have this code
HCURSOR hcur;
hcur = ::LoadCursorFromFile((LPCWSTR)"C:\\eglobe.ani");
::SetSystemCursor(hcur,OCR_NORMAL);
This bit - (LPCWSTR)"C:\\eglobe.ani" - will not work. The string literal is of type LPCSTR. That cannot be correctly converted to LPCWSTR with a simple cast. Instead, use this:
hcur = ::LoadCursorFromFile(_T("C:\\eglobe.ani"));
The _T macro either uses the string literal ("C:\\eglobe.ani" ) or the wide-char equivalent (L"C:\\eglobe.ani" ) as necessary
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Now my code is as below:
But Still it enters else bock ie.,"Failed"
CString s("Sucess");
HCURSOR hcur;
hcur = ::LoadCursorFromFile(_T("C:\\eglobe.ani"));
if(hcur!=NULL)
{
::SetSystemCursor(hcur,OCR_NORMAL);
}
else
{
s="Failed";
}
|
|
|
|
|
This worked, but setting back the curso to normal did not work ie.,last statement
Plese help
CString s("Sucess");
HCURSOR hcur;
HCURSOR hCurBusy = ::LoadCursor(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ANICURSOR1));
HCURSOR hCurStandard = ::LoadCursor(NULL, IDC_ARROW);
::SetSystemCursor(hCurBusy,OCR_NORMAL);
int i;
while(some length process)
{
}
::SetSystemCursor(hCurStandard,OCR_NORMAL);
|
|
|
|
|
This worked, but setting back the curso to normal did not work ie.,last statement
Plese help
HCURSOR hcur;
HCURSOR hCurBusy = ::LoadCursor(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ANICURSOR1));
HCURSOR hCurStandard = ::LoadCursor(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_NORCURSOR));
::SetSystemCursor(hCurBusy,OCR_NORMAL);
int i;
while(i=0)
{
Sleep(100);
i++;
}
::SetSystemCursor(hCurStandard,OCR_NORMAL);
|
|
|
|
|
ptr_Electron wrote: ::SetSystemCursor(hCurBusy,OCR_NORMAL);
Eeep - that's the WRONG way to change cursors.
With Windows, you either set the cursor in a window's class or respond to WM_SETCURSOR[^] messages to set the cursor. Your way is changing the cursor for the whole system - people will cuss you if you do that.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Can you please help me to understand how to respond to WM_SETCURSOR
|
|
|
|
|
OK...you need to add a WM_SETCURSOR message handler to the window where you want your special cursor to be shown. This handler should use SetCursor to change the cursor to the one you want and return TRUE.
The form of the message handler obviously depends on what Windows framework (if any you're using) - here's an example using MFC[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|