Click here to Skip to main content
14,698,687 members

Comments by Member 14837073 (Top 30 by date)

CFont font;

This code also I tried please help ...I have spend time lots
waiting for the response
Hi everyone please check my code and give some solutions i try everything ,
pleases help me for this

Every code i try but its not changing

CFont* currentFont = GetFont();
lf.lfHeight = 50;
m_font.CreateFontIndirect(&lf); // Create the font.

// Use the font to paint a control.
Member 14837073 2 days ago View
Yeh its calling the return value of CreateFont,

But I did not get any changes in Command Link button

@Richard MacCutchan above the code Modify as your knowledge and send me its will helpful for me
Member 14837073 2 days ago View
I try with above the link its not working , help me for the any others method
Member 14837073 12-Oct-20 6:12am View
Device which i am working on rs232 serial port

Smal project which given to me is , rs232 serial port monitoring

Data which i am sending through editbox , its should write in hexadecimal n read in a hexadecimal and print as ASCII value ...

byte which u mentioned, i tried write with 0 bytes n read with 0 bytes its working fine

but how do i write Arry bytes in hexadecimal in WriteData() function which i am geting from edibox value
Member 14837073 20-Aug-20 2:38am View
I tried but same issue i am facing
Member 14837073 18-Aug-20 3:16am View
void CUtilitiesTab::OnBnClickedCheck2()
int rc;
IPAddr ia;
ia = inet_addr(m_ip_address);
rc = NewPing(ia, (ULONG*)&m_hops_count, (ULONG*)&m_rtt);
if (rc == 0)
m_selftestresult.SetWindowTextW(_T("Host not responding or no route, rc = %d", rc));

int NewPing(IPAddr ia, ULONG* hops_count, ULONG* rtt)
boolean IsOk;

IsOk = GetRTTAndHopCount(ia, hops_count, 128, rtt); //the iphlpapi call
if (IsOk == TRUE) return 0;
return GetLastError();


#pragma once

// CUtilitiesTab dialog

//#ifndef __SERIAL_H__

class CUtilitiesTab : public CDialogEx

CUtilitiesTab(CWnd* pParent = nullptr); // standard constructor
virtual ~CUtilitiesTab();

// Dialog Data

HICON m_hIcon;

// Generated message map functions
virtual BOOL OnInitDialog();
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support

bool IsCheck1Checked;
CButton m_mil1553;
CButton m_ethernet;
CButton m_discrete;
CString m_resultTxt;
afx_msg void OnBnClickedMfcbutton1();


char m_ip_address[4];
long m_hops_count;
long m_rtt;
afx_msg void OnBnClickedCheck2();

what i tried here.
here i am just declare the IP adress as hardcode , when i click checkbox its should saw the output in edittext like "pass" or "fail"..

but here i am geeting the error

Error C4996 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings MGTS

if anyone can help me out this that would be great full
Member 14837073 3-Jul-20 2:31am View
i will come back all the details ,
sample program which i told about below ,,

wBoardCountLocal = ApiInit (); /* Local board access */
if ( useServer ) { /* Remote board access */ retVal = ApiConnectToServer(strServerName , &wBoardCountRemote); }
xApiOpen.ul_Module = 0; xApiOpen.ul_Stream = API_STREAM_1; sprintf ( xApiOpen.ac_SrvName, xConfig . acServer );
retVal = ApiOpenEx(&xApiOpen, &ulModHandle );

retVal = ApiClose(boardHandle );
if ( useServer ) ApiDisconnectFromServer(strServerName );
ApiExit ();
Member 14837073 30-Jun-20 5:33am View
"unhandeled exception at 0x6a112efo (msvcr90d.dll) in kgf .exe : 0xc0000005: Access vilotaion reading location 0x8370c29c "
i geting this error
Member 14837073 16-Jun-20 4:56am View
Thank you soo much , Cpallini
its works
Member 14837073 16-Jun-20 4:26am View
no operator "+=" matches these operands
Member 14837073 16-Jun-20 2:27am View
const unsigned char nbuf[] = { 'A', 'B', '\0', '\0', 'C', 'd', 'e', 'f' };

above the programs , vice virsa ...
I am trying with same way i didnt get if any changes let me know

Expecting output will be "65 66 0 0 67 100 101 102"
Member 14837073 16-Jun-20 2:27am View
const unsigned char nbuf[] = { 'A', 'B', '\0', '\0', 'C', 'd', 'e', 'f' };

above the programs , vice virsa ...
I am trying with same way i didnt get if any changes let me know

Expecting output will be "65 66 0 0 67 100 101 102"
Member 14837073 16-Jun-20 2:22am View
Thank you soo much its works ,this just demo programs this way i need implement in serial monitoring ,thanks once again
Member 14837073 16-Jun-20 1:30am View
i am sorry i am not able to make understand you guys , i am new in developers filed ,
lets again i will try to explain , for Example

CString msg;
char nbuf = 67

msg.Format(L"%c", (BYTE)nbuf);

above the program i am geting output C (67 ascii value character is "C") , Now what i want is array format . the ascci value are in ,
char nbuf[]={67,68,69} ,this i want character 67=C,68=D,69=E ,it means the want output is "CDE" either above the program i doing correct or wrong please make it help ,i hope i make you understand ...thank you
Member 14837073 15-Jun-20 9:36am View
CString msg;
wchar_t nbuf[] = L"ABC";
msg.Format(L"%d", nbuf);
even i try this one it was like character to change the integer but this also i did not get proper out i am geting dummy value ....
Member 14837073 15-Jun-20 9:33am View
I hope you understand my questions,

Here i am talking about conversions ...
for exmple
char nbuf[10] = {67,68,69,70,70,72};
msg.Format(L"%c", (BYTE)nbuf[0]);

i am geting output for this "C" but i want the output something like "CDEF"..but i doing correct or wrong above code but i want help
Member 14837073 3-Jun-20 13:42pm View
i starting from the basic ,my requirement is my data is come from hardware based in ASCII format ,Above the code i want to print in static text in mfc ,how do i do that

m_result_ascii ///variable of static text
Member 14837073 3-Jun-20 13:42pm View
Above code is character to ASCII value ,(WHICH is did code based on that)
which i mentioned ASCII code convert to character (my expected).

TRACE( "ASCII format is : %c\n", myByte ); //solutions 2 it help me out in mfc to get character
Member 14837073 3-Jun-20 13:08pm View
Thanks , i will try this
Member 14837073 3-Jun-20 13:08pm View
Thanks , i will try this
Member 14837073 3-Jun-20 13:06pm View
Yeh something wrong is there ,no any idea
Member 14837073 3-Jun-20 11:40am View
u help me to modified the code which i tried to print ASCII character ..
Member 14837073 3-Jun-20 11:40am View
u help me to modified the code which i tried to print ASCII character ..
Member 14837073 3-Jun-20 11:19am View
for (int i = 0; i < 122; i++){
int asciiVal = rand()%97 + 122;
char asciiChar = asciiVal;
cout << asciiChar << " ";
Above the progrmas i getting error ,i want to print character value "a" to "z" and dumbed into static text in mfc

BOOL CAsciidemoDlg::OnInitDialog()

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != nullptr)
BOOL bNameValid;
CString strAboutMenu;
bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

char nchar = 65;
m_ASCIIRESULT = nchar; /** here i want to dumbed the data which i will get the
output in cout.
// TODO: Add extra initialization here

return TRUE; // return TRUE unless you set the focus to a control
Member 14837073 3-Jun-20 10:06am View
Thanks ,lets try and i will update once when i complete
Member 14837073 1-Jun-20 7:40am View
Thank you Richard Macutchan
Member 14837073 1-Jun-20 5:42am View
Yes ,i got the output what i expected through the solutions 3
Member 14837073 1-Jun-20 0:35am View
For serial port Monitoring ,while monitoring the port i should work with main window
Member 14837073 1-Jun-20 0:33am View
Thank you so much its help me lot
and its working fine while copying code
i am new here and learning programming ,you guys are really helpful
Thank you once again