|
Hi All,
I want to write software modems(VC++/MFC/SDK).
Please let me know if any algorithm or links are available with you.
Thanks
|
|
|
|
|
I have a situation similar to following:
int b;<br />
<br />
int afunction() {<br />
int b = 0;<br />
...<br />
}<br />
I need to access global b in afunction?? C does not have :: operator. I cannot change the identifier of both local and global variable b. Is there a way around??
ARSALAN MALIK
|
|
|
|
|
Arsalan Malik wrote:
I need to access global b in afunction??
No, there is no such operator in C language.
Arsalan Malik wrote:
Is there a way around??
May be you can write a getter function for the global b.
suhredayan There is no spoon.
|
|
|
|
|
Arsalan Malik wrote:
Is there a way around??
Yes, don't use b in both spots.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Try this:-
int b;
int afunction() {
extern int b = 0;
...
}
|
|
|
|
|
Try this
int b;
int afunction()
{
int *ptr= &b;
int b = 0;
.....
}
|
|
|
|
|
could anyone plz tell me as soon as possible how to convert an unsigned char to const char using vc++ code?
|
|
|
|
|
nehathoma wrote:
could anyone plz tell me as soon as possible how to convert an unsigned char to const char using vc++ code?
I believe we can do it that by using normal C++ code.
I think you are looking for conversion of unsigned char string to signed char string instead of unsigned char to signed char.
Here anyways, this Task can be accomplish by using typecasting! (if you don't know what exactly the type casting is? please refer to your TEXT book!)
unsigned char *unChar=(unsigned char*) "unsigned string";
char sigString[100];
strcpy(sigString,(const char*)unChar);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ThatsAlok wrote:
I believe we can do it that by using normal C++ code.
I think you are looking for conversion of unsigned char string to signed char string instead of unsigned char to signed char.
Here anyways, this Task can be accomplish by using typecasting! (if you don't know what exactly the type casting is? please refer to your TEXT book!)
//typecasting By direct initialization
unsigned char *unChar=(unsigned char*) "unsigned string";
//second Unsigned char string to signed char string
char sigString[100];
strcpy(sigString,(const char*)unChar);
Which C++ book did you see the type casting as above ?
suhredayan There is no spoon.
|
|
|
|
|
I asked her to get concept of Typecasting by reading the Book.
Anyways some books taught you typecasting by using macro like static_cast , reinterpret_cast and dyanamic_cast
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ThatsAlok wrote:
Anyways some books taught you typecasting by using macro like static_cast, reinterpret_cast and dyanamic_cast
Dear Alok,
static_cast, reinterpret_cast etc are not macros. They are casting operators in C++ language.
suhredayan There is no spoon.
|
|
|
|
|
suhredayan® wrote:
static_cast, reinterpret_cast etc are not macros. They are casting operators in C++ language.
then i am really sorry!, I take back my words !, Now i have to refer TEXT BOOK
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
but thats not working for me Alok!!!!!!!!!1
|
|
|
|
|
Hi Neha,
Could you please post some code snippet excatly where u facing problem!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
CString tr=m_edit1.Left (m);
tr.Delete (0,m-1);
tr.Format("%d",ch);(this is where i am stuck)
c i want to convert the string "tr" to char.is there any problem with the format string i have used.....
the data type used for 'ch' is unsigned char......
data =(double)ch;
|
|
|
|
|
nehathoma wrote:
CString tr=m_edit1.Left (m);
i smell some problem here!
//i don't understand use delete and format here!
tr.Delete (0,m-1);
tr.Format("%d",ch);(this is where i am stuck)
First you delete whole string except last character from tr then you copy a new string from CString::Format
please clarify what exactly you want to do here!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
u know why i used the stmt:
CString tr=m_edit1.left(m)
to retrieve th charachters in the string one by one....
tr.delete("%d",ch)
is used to convert the retrieved characters one by one to ch.....
|
|
|
|
|
nehathoma wrote:
c i want to convert the string "tr" to char.is there any problem with the format string i have used.....
CString::Format() function is used to write something into CSting object. From your post I feel you want to convert tr to character. With the assumption tr will have only one character at that time.
try this then:
ch = tr.GetAt(0);
suhredayan There is no spoon.
|
|
|
|
|
thank u i got that with what u said
|
|
|
|
|
nehathoma wrote:
thank u i got that with what u said
was a wild guess
suhredayan There is no spoon.
|
|
|
|
|
Hi All,
I am using following code to establish a secure connection. But WinHttpSenRequest() fails. The error number returned by GetLastError() is 87, which dont seems to have relation with WinHttpSendRequest().
hSession = WinHttpOpen( L"OFX Download", WINHTTP_ACCESS_TYPE_NAMED_PROXY,
L"192.168.0.48:1749", L"<local>", 0);
if (!hSession)
{
ATLTRACE("Internet Open Failed");
return false;
}
hConnect = WinHttpConnect( hSession,L"ofxServer.com" , INTERNET_DEFAULT_HTTPS_PORT , 0);
if ( !hConnect )
{
DWORD nErr = GetLastError();
WinHttpCloseHandle(hSession);
return false;
}
hRequest = WinHttpOpenRequest( hConnect, L"GET", L"/ofxproxy/ofx_proxy.dll", NULL, WINHTTP_NO_REFERER, NULL, WINHTTP_FLAG_SECURE);
if ( !hRequest )
{
WinHttpCloseHandle(hConnect);
WinHttpCloseHandle(hSession);
return false;
}
CA2W qry(csPostString.GetBuffer()) ;
bResults = WinHttpSendRequest( hRequest, qry, wcslen(qry), WINHTTP_NO_REQUEST_DATA ,0, 0 , 0);
if (!bResults)
{
DWORD dwError = GetLastError();
WinHttpCloseHandle(hRequest);
(hConnect) WinHttpCloseHandle(hConnect);
(hSession) WinHttpCloseHandle(hSession);
return false;
}
Same task is being done very efficiently using WinInet. But due to some reasons I have to move towards WinHTTP.
|
|
|
|
|
Can anyone clarify the following problem.
I have added a listcontrol to a property page and set it to 'Report' view .
I have set 'Nocolumnheader' to TRUE.
When I set the view to 'List', the list items are added and displayed but when i set it to 'Report' view no items are added to the listcontrol.
Thanx in advance
laiju
|
|
|
|
|
|
You still need to add one or more columns to the control; setting the LVS_NOCOLUMNHEADER style just hides the header control above the columns.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
i appreciate ur resonse.
But i dont any columns rather i want all the items to be listed in report view.Thats the reason why i set NoColumnheader property to TRUE.
Still the items are added in list view but not in report view
laiju
|
|
|
|