|
There are some usefull articles and classes here[^]
|
|
|
|
|
I_arora wrote: I could execute 'C' code for serial port communication on DOS based environment. I need to do it using VC++. I am completely new to it. How should I start?
In addition to cedric.. i would like to recommend you CSerialPort class listed there!.. it is one of best freely available class for Serial Post Communitcation
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Re
|
|
|
|
|
I_arora wrote: I need to do it using VC++.
See here.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
It depends how hard you want to work!
If you want to work really hard, learn C++. Sure, it has long-term benefits, but it's a lot of work!
If you don't want to work so hard, use the C code you already know, and hack it to work under Windows. Start by making a console application, copy in your old code, fix compiler errors, etc. It's not pretty, but it may work!
Where you are likely to hit a problem is when you directly access I/O ports, but you can use a "port access" library. I have personally used inpOut32.dll http://www.logix4u.net/inpout32.htm[^]- works like a dream. This library provides inp32 and out32 functions, which allow you to directly access ports, as in DOS or Win9x.
|
|
|
|
|
|
all i want is to search in column 1 not 0 how ? in this code !!!! please help !!!
this code find an item in column 0 !
void CMyList::OnOK()
{
UpdateData();
CWaitCursor wait; // Display a wait cursor
int x = m_list.GetItemCount();
for (int j = 0; j < x; j++) // For each item in the list
{
CString strWord;
strWord = m_list.GetItemText(j, 0); // Get the word
strWord.TrimLeft(); // Remove leading spaces
strWord.TrimRight(); // Remove trailing spaces
// Overwrite the old word with the new trimmed word
m_list.SetItemText(j, 0, strWord);
}
//----------------------------------------------------------------------------------//
CString sName = _T("Name");
m_name.GetWindowText(sName);
LVFINDINFO stInfo = {0};
stInfo.flags = LVFI_STRING;
stInfo.psz = sName;
int nItem = m_list.FindItem( &stInfo );
if( nItem != -1 )
{
// the item is in the list control
CString sSecondColumnText = m_list.GetItemText( nItem, 1 );
// set the text to the second edit box
m_rezult.SetWindowText( sSecondColumnText );
}
}
how ?
please an example !!!!
please help !
i will wait your answer because i don t now how ,i don t have no ideea !
Bravoone
|
|
|
|
|
LV_FINDINFO lfi = { 0 };
lfi.flags = LVFI_STRING;
lfi.psz = "Test"
int iItem = ListView_FindItem (m_List, -1, &lfi);
if (-1 == iItem)
{\\error}
else
{
//success
}
|
|
|
|
|
I remind you : m_list (CListCtrl), m_name (CEdit),m_rezult(CEdit)
this code is not working ! (in my code)
i need more help !
please !!!
Bravoone
|
|
|
|
|
Did you see my previous reply?its working for colunms 1,2,3,...
|
|
|
|
|
this is not good i thing! i have try!
how can i : in my code ?
LV_FINDINFO lfi = { 0 };
lfi.flags = LVFI_STRING;
lfi.psz = "Test"
int iItem = ListView_FindItem (m_List, -1, &lfi);
if (-1 == iItem)
{\\error}
else
{
//success
}
///////////////////////////////////////////////////////////////////////
my code:
//////////////////////////////////////////////////////////////////////
void CMyList::OnOK()
{
UpdateData();
CWaitCursor wait; // Display a wait cursor
int x = m_list.GetItemCount();
for (int j = 0; j < x; j++) // For each item in the list
{
CString strWord;
strWord = m_list.GetItemText(j, 0); // Get the word
strWord.TrimLeft(); // Remove leading spaces
strWord.TrimRight(); // Remove trailing spaces
// Overwrite the old word with the new trimmed word
m_list.SetItemText(j, 0, strWord);
}
//----------------------------------------------------------------------------------//
CString sName ;
m_name.GetWindowText(sName);
LVFINDINFO stInfo = {0};
stInfo.flags = LVFI_STRING;
stInfo.psz = sName;
int nItem = m_list.FindItem( &stInfo );
if( nItem != -1 )
{
// the item is in the list control
CString sSecondColumnText = m_list.GetItemText( nItem, 1 );
// set the text to the second edit box
m_rezult.SetWindowText( sSecondColumnText );
}
}
Bravoone
|
|
|
|
|
When i wanted to send you this code i tested this code
whats problem?
|
|
|
|
|
Please explain how ?
i have try this and is the same thing i have just done for column 0!
CString sName;
m_name.GetWindowText(sName);
LV_FINDINFO lfi = { 0 };
lfi.flags = LVFI_STRING;
lfi.psz = sName;
int iItem = ListView_FindItem (m_list2, -1, &lfi);
if (-1 == iItem)
{ AfxMessageBox("Invalid ");
return;
}
else
{
// the item is in the list control
CString sSecondColumnText = m_list2.GetItemText( iItem, 1 );
// set the text to the second edit box
m_rezult.SetWindowText( sSecondColumnText );
}
Bravoone
|
|
|
|
|
|
When you used from a loop for read columns what happen Is your listctrl type report
|
|
|
|
|
yes my list type is report !
Please help me with my code !
Bravoone
|
|
|
|
|
Hi all,
I found that using CRectTracker we can move the Drawn ellipse,circle and Rectangle.
Let me know any code snippet for CRectTracker. please help me out.
Uday kiran
|
|
|
|
|
uday kiran janaswamy wrote: CRectTracker
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
I have an app that is controled using keypresses. Currently I use WinProc to capture the key presses and process them. My problem is non US layout keyboards.
Example: If I wanted to test for a '?' key press on a US layout keyboard, I get a 'Shift' keypress and a '/' keypress. Most other international layouts do not have the '/' and '?' on the same key so this does not work.
Is there anyway to capture a '?' or any other non-alphanumeric keys that require either shirt or alt to be presses. I.e returning the unicode of the key. Can this be done using windows API or should I be looking elsewhere? SDL or something?
---
|
|
|
|
|
My suggesting is not to capture the key status because the different keyboard has differnt layout that why windows does TranslateMessage() for us .U put the ASCII value of the key in Switch case in WinProc
never say die
|
|
|
|
|
Coremn wrote: Example: If I wanted to test for a '?' key press on a US layout keyboard, I get a 'Shift' keypress and a '/' keypress. Most other international layouts do not have the '/' and '?' on the same key so this does not work.
how are you comparing the returning key press!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Re
|
|
|
|
|
Hi, Ima using prot numbers for my appilcatio to connect cleint through sockets.Im using port numbers between 1220...Is there any restriction to use any numbers?I dont know about that procedure..Pls help me out?
Anu
|
|
|
|
|
Yes there is restriction to use port no from 1 to 1024.
This are available for system application.
regards,
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
Can we change the dpi(horizontally/vertically) of a tiff file programatically using any tool or api.
Please help
Thank You.
-- modified at 3:08 Thursday 10th August, 2006
KIRAN PINJARLA
|
|
|
|
|
I'm new to c++ so I'm mucjing around with pointers and re-inventing the wheel for educational purposes so...
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
int my_arrLen( char *strA ){
int loopCtr=0;
while (*strA != '\0'){
cout << *strA;
*strA++;
loopCtr++;
cout << loopCtr;
}
return loopCtr;
}
char *theStr;
int main()
{
gets(theStr);
puts("You entered a string with length: ");
cout << my_arrLen(theStr);
}
crashes with a reference to mscvrt
-- modified at 1:21 Thursday 10th August, 2006
|
|
|
|