|
<br />
extern CListCtrl* pmyListCtrl;<br />
extern LPCTSTR lpszmyString;<br />
<br />
LVFINDINFO info;<br />
int nIndex;<br />
<br />
info.flags = LVFI_PARTIAL|LVFI_STRING;<br />
info.psz = lpszmyString;<br />
<br />
string lpszmyString.<br />
while ((nIndex=pmyListCtrl->FindItem(&info)) != -1)<br />
{<br />
}<br />
<br />
But my doubt is will the above code search all the columns and rows in the listctrl, or just the 1st column, for the lpszmyString string
?
That is I want the code to search only the first column to be searched for the string.
Thank you.
|
|
|
|
|
By definition, it finds items (i.e., the 1st column). Having never used it, I can't be for sure.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi all,
I want to create and read/write a file. If I use fstream class, I can open only the file already exits.
If I want to create a new file. What can I do?
Thank you very much.
Tran Phuong Nga
|
|
|
|
|
tpndtbk wrote:
If I use fstream class, I can open only the file already exits.
If I want to create a new file. What can I do?
use ios::in in Second Parameter of fstream object initialization
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
HI,
I did like following:
fstream *fout;
fout = new fstream("data.dat", ios::in | ios::out | ios::binary);
fout->write((const char*)name, sizeof(Names));
//Names is a struct and name is a variable of Names type
fout->close();
-----------
So what is wrong in these codes?
I run this code, no errors but the file is not created!
Thank you
|
|
|
|
|
I tried your code (except I did not use a pointer) and it worked as expected. Perhaps it is a permission-related issue.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
As with David's comment above, but also be aware of the location that your file is being created.
tpndtbk wrote:
fout = new fstream("data.dat", ios::in | ios::out | ios::binary);
You supplied only the filename, not a definite path, which means that the file will be created in the current directory. This, in most cases, may very well be in your ..\debug\ subfolder.
I Dream of Absolute Zero
|
|
|
|
|
HI,
THank you.
My program runs without any error but there's no file created. I think I have problem with writing permission. But I don't know how to solve it.
Can anyone help me out?
|
|
|
|
|
And there's a strange thing that:
If I write:
fstream *fout;
fout = new fstream("data.dat", ios::in | ios::out | ios::binary);
if (!fout->is_open())
{
cout << " can't open the file" << endl;
return 1;
}
fout->write((const char*)name, sizeof(Names));
---> the result is "can't open the file";
But if I don't check if the file is open.
fstream *fout;
fout = new fstream("data.dat", ios::in | ios::out | ios::binary);
fout->write((const char*)name, sizeof(Names));
--> there's no error but there's no file created. I think if the file doesn't exist, the instruction "fout->write((const char*)name, sizeof(Names));" should cause an error. Right?
|
|
|
|
|
Hi,
I'm trying to set up BlueTooth comunication between 2 devices,by using Virtual COM Port,with the RegisterDevice() function.
The problem is that the last parameter required the BD_ADDR(BlueTooth address) of the device i want to connect to.
How can i get the asddress????
Regards,
Eli
|
|
|
|
|
BTH_ADDR which is a MAC address,
not BD_ADDR that is an IP address
but i don't remember how
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
First,thanx for your prompt reply.
According to MSDN:
When the client or server starts, it creates a COM port to associate
with the Bluetooth stack in the following manner:
HANDLE h = RegisterDevice (L"COM", index, L"btd.dll", (DWORD)&pp);
For the client, the Bluetooth server address (pp) is passed into the
pp.device member in the PORTEMUPortParams structure(and pp.device type is
BD_ADDR).
Anyone???
Regards,
Eli.
|
|
|
|
|
Hey,
I lost the Intgration of VSS with my MSDEV. In the "projects" menu, there is no "Source control" option. There is no such tab in "Options" too.
How can i reintegrate MSDEV with VSS?
Thanks in ADvance
shijuck
|
|
|
|
|
|
How I re-register ssscc.dll ?
I dont have the previous experience in it.
please help me.
shijuck
|
|
|
|
|
|
Hi
Does anyone know how I can find out what exception has actualy
been thrown when I catch it with catch (...) block.
/Per
|
|
|
|
|
all the other exceptions that has not been catched with previous catch block. you can imagine its behavior like the default statement of a switch...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I woul'd like to catch the exception, but I don't know what type it is. Can I figure that out in some way?
|
|
|
|
|
|
I don't think so either. In cases where you specify the exception type, you can do something like catch(CexType& ex)
and that gives you an object you can interrogate, perhaps using RTTI, but in the ellipsis case, there's nothing to help you.
Steve S
Developer for hire
|
|
|
|
|
Most frameworks provide a base class that all exceptions should be derived from for this reason. For example MFC has a CException class.
In all but the most exceptional (pun intended) circumstances exceptions should derive from std::exception, the exception base class for the C++ Standard library. Rather than catch(...), use catch(std::exception& )
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I am using a dll that is returning a byte buffer and bitmapinfoheader
my front end is mfc appliction dialog box and now i want to draw that image byte buffer (that is accompanied by bitmapinfoheader)to my dialog box also the image is very large so i wan to scale it inorder to draw.
can any body help me
|
|
|
|
|
I know it's a little old, but this function works and is pretty easy to use.
DrawDibDraw()
|
|
|
|
|
use BitBlt().....
that might help.....
happy programmin.....
cheerz.....
|
|
|
|