|
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
|
|
|
|
|
i dont need a column header since i dont want multiple columns.
I just want to display all the list items in a report style.
Thats the reason i set NoColumnHeader to TRUE.
But even after setting NoColumnHeader to FALSE ,the list items arent visible.I guess they are not added because when i try to fetch the total count it says zero.
But my code works fine if the view property is set to ' list ' .
I have attached my code .Pls..verify if possible.
void CFontPage::OnFontSelection() // fills the list box with unique font types
{
bool bNewEntry;
int iIndex;
int iListItems;
int iResult;
TCHAR cFont[MAX_LIST_CHARS];
TCHAR cListFont[MAX_LIST_CHARS];
CString sFont;
LVITEM lvItem;
bNewEntry = TRUE;
iIndex = m_FontType.GetCurSel();
m_FontType.GetLBText(iIndex,cFont);
iListItems = m_FontList.GetItemCount();
for (iIndex = 0; iIndex < iListItems; iIndex++)
{
m_FontList.GetItemText(iIndex,NULL,cListFont,sizeof(cListFont));
iResult = strcmp(cListFont,cFont);
if (0 == iResult) //matching font .Font already available in list
{
bNewEntry = FALSE;
}
memset(cListFont,'\0',sizeof(cListFont));
}
if (TRUE == bNewEntry)
{
iListItems++;
lvItem.mask = LVIF_TEXT|LVIF_STATE;
lvItem.state = LVIS_SELECTED;
lvItem.stateMask = NULL ;
lvItem.iItem = iListItems;
lvItem.pszText = cFont;
lvItem.iSubItem = NULL;
m_FontList.SetItem(&lvItem);
m_FontList.InsertItem(&lvItem);
}
SetModified(TRUE);
}
void CFontPage::OnClickedRemove() // deletes currently selected list items
{
int iIndex;
LVITEM lvItem;
iIndex = m_FontList.GetSelectionMark(); // retrieves current selected list item
m_FontList.DeleteItem(iIndex);
}
laiju
|
|
|
|
|
laiju wrote:
iListItems++;
Why is this variable being incremented? The for loop compares iIndex to this variable to know when to terminate. By incrementing it, doesn't that mess things up?
In any case, if you are only adding data to the first column, why use a list control over a listbox?
Even though the list control has the LVS_NOCOLUMNHEADER style, you still need to make a call to m_FontList.InsertColumn(0, "", LVCFMT_LEFT, 100) so that the column width is set.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hello friends
i m making sniffer using vc++ and want some fields they r
1. system's cpu usage
2.network packet/sec.
3.memory usage
4. number of connections
5.connection attempts.
6.protocol used
7.available network bandwidth.
plz tell me functions used to retrieve these fields
plz reply soon, its very urgent.
bye
|
|
|
|
|
smarty12 wrote:
plz reply soon, its very urgent.
It's always urgent.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
smarty12 wrote:
hello friends
i m making sniffer using vc++ and want some fields they r
1. system's cpu usage
2.network packet/sec.
3.memory usage
4. number of connections
5.connection attempts.
6.protocol used
7.available network bandwidth.
look for IPhelper api's for network related problem here is URL for that
http://www.codeproject.com/internet/IPHelper.asp[^]
and for cpu related problem again here is URL
http://www.codeproject.com/threads/getprocesstimes.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi,
Could some of you tell me what's the function of the syntax below:
Thanks alot!
LRESULT CALLBACK WindowFunc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK onCAPErrorCallback(HWND WhatWindow, int ErrorID, LPSTR ErrorMessage);
LRESULT CALLBACK OnVideoStreamCallback(HWND hWnd, LPVIDEOHDR lpVHdr);
LRESULT CALLBACK detectionFunc(HWND , UINT , WPARAM , LPARAM );
|
|
|
|
|
A callback is a function that is passed as a pointer, and called from within another function, so you can get a 'call back' during the functions execution.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
hello everybody, i want ask a question about how to display symmetric matrix based on the following code when we only input 6 value of array into it?
#include <iostream>
using namespace std;
void main()
{
int array[6];
int i , j ;
cout << "Enter the values of the following :" << endl << endl;
for ( i = 0 ; i < 3 ; i++ )
{
for ( j = 0 ; j < 3 , j <= i ; j++ )
{
cout << " ["<<i<<"]["<<j<<"] =="" ";
="" cin="">> array[i];
}
}
cout << endl;
for ( i = 0 ; i < 3 ; i++ )
{
for ( j = 0 ; j < 3 ; j++ )
{
cout << " ["<
|
|
|
|
|
Why not create a 2D array ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
well, it is hard to answer this one... not because I can't see the problem, but I can't figure out what you intended to do....
Were you trying to input the value for a 3x3 two dimensional array and output the same? Or were you trying to simulate a two dimensional array using a 1 dimensional array?
here is what I can note from what you are actually doing....
You are using only 3 values of the array, and overwriting them constantly using the inside loop.
if you want a 2 dimensional array, you want to define it with
int array [3][3]; // 9 total values in square 2 dimensional array
and input and output using
array[i][j];
if you want to use 9 values in a one dimensional array but input with 2 dimensions.
int array [9];
and access with:
array[i*3+j];
but without knowing what you intended to do, all I can tell you is that you are overwriting the values over and over and therefore not getting good input.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
I changed the sample I found on this site to set recording time by bytes, but it still records by number milliseconds.
What is correct setting for recording by number of bytes?
DWORD CMyRecordDlg::RecordWAVEFile(DWORD dwMilliSeconds)
{
UINT wDeviceID;
DWORD dwReturn;
MCI_OPEN_PARMS mciOpenParms;
MCI_RECORD_PARMS mciRecordParms;
MCI_SAVE_PARMS mciSaveParms;
MCI_PLAY_PARMS mciPlayParms;
// Open a waveform-audio device with a new file for recording.
mciOpenParms.lpstrDeviceType = "waveaudio";
mciOpenParms.lpstrElementName = "";
if (dwReturn = mciSendCommand(0, MCI_OPEN,
MCI_OPEN_ELEMENT | MCI_OPEN_TYPE,
(DWORD)(LPVOID) &mciOpenParms))
{
// Failed to open device; don't close it, just return error.
return (dwReturn);
}
// The device opened successfully; get the device ID.
wDeviceID = mciOpenParms.wDeviceID;
//YTV
MCI_SET_PARMS Set;
Set.dwAudio=MCI_SET_AUDIO_ALL ;
Set.dwTimeFormat=MCI_SET_TIME_FORMAT|MCI_FORMAT_BYTES;
dwReturn = mciSendCommand(wDeviceID, MCI_SET,
MCI_WAIT|MCI_TO|MCI_FROM , (DWORD) &Set);
if(dwReturn!=0)
{
mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
return (dwReturn);
}
//YTV
// Begin recording and record for the specified number of
// milliseconds. Wait for recording to complete before continuing.
// Assume the default time format for the waveform-audio device
// (milliseconds).
mciRecordParms.dwTo = 1000;//dwMilliSeconds;
if (dwReturn = mciSendCommand(wDeviceID, MCI_RECORD,
MCI_TO | MCI_WAIT, (DWORD)(LPVOID) &mciRecordParms))
{
mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
return (dwReturn);
}
// Play the recording and query user to save the file.
mciPlayParms.dwFrom = 0L;
if (dwReturn = mciSendCommand(wDeviceID, MCI_PLAY,
MCI_FROM | MCI_WAIT, (DWORD)(LPVOID) &mciPlayParms))
{
mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
return (dwReturn);
}
if (MessageBox("Do you want to save this recording?",
"", MB_YESNO) == IDNO)
{
mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
return (0L);
}
// Save the recording to a file named TEMPFILE.WAV. Wait for
// the operation to complete before continuing.
mciSaveParms.lpfilename = "tempfilebytes.wav";
if (dwReturn = mciSendCommand(wDeviceID, MCI_SAVE,
MCI_SAVE_FILE | MCI_WAIT, (DWORD)(LPVOID) &mciSaveParms))
{
mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
return (dwReturn);
}
return (0L);
}
ytvsoftware
|
|
|
|
|
Hi,
I was wondering if anyone knows of a simple way to force a console to close - even if it's running an application. I have no problem finding the consoles (with EnumWindows, using GetClassName etc.), but of course I can't close them if they are currently running an application (which I also want terminated). Is there anyway to automatically do this, or at least to easily find the associated application that I can then kill first? Thanks.
GraemeS
|
|
|
|
|