|
I must cast the szBuffer to a CString type:
CString csPath = szBuffer;
is this allowed?
Thanks, Mark
|
|
|
|
|
Actually, this implicitly casts szBuffer to a LPCTSTR, which CString has an assignment operator for.
|
|
|
|
|
Nice, but still generates test.pmjyyyxx as output????
Thanks, Mark
|
|
|
|
|
CFileDialog dlg(FALSE);
dlg.DoModal();
CString fname = dlg.GetPathName();
const char* szBuffer = fname;
char s[128];
int i = lstrlen(szBuffer);
CFile f;
if (f.Open("F:\\test\\id.txt", CFile::modeWrite | CFile::modeCreate) == TRUE)
{
try
{
f.Write(szBuffer, i);
}
catch (CFileException *e)
{
AfxMessageBox ("Error writing!");
e->Delete();
}
f.Close();
}
if (f.Open("F:\\test\\id.txt", CFile::modeRead) == TRUE)
{
try
{
f.Read(s, i);
}
catch (CFileException *e)
{
AfxMessageBox ("Error reading!");
e->Delete();
}
}
|
|
|
|
|
int i = strlen (szBuffer);
rechi
|
|
|
|
|
Hi
Let's say i have a CString:
CString mytext = "1G-I8-EJ-89-B6";
I want to have a little security and i thought of substituting some characters with some others within that CString.
Like for example:
'0' to 'J'
'1' to 'H'
'2' to 'A'
I thought of making a two-dimensional char array.
'0' 'J'
'1' 'H'
'2' 'A'
'3' '9'
....
is there a short way to write this?
instead of using mychar[0][0]='0';
mychar[1][0]='J';
and how can i easily convert an int to a char?
Best regards
Jens
|
|
|
|
|
hi,
try this one
in your header file declare:
<br />
extern char Array2ofChar[2][10];<br />
in the correspondending c/cpp file write:
<br />
char Array2ofChar[2][10]=<br />
{{'0','1'},<br />
{'A','2'},<br />
...<br />
};<br />
that should do the trick.
G. Steudtel
|
|
|
|
|
Hi
I've been searching a long time for a code sample that could show me how to create a Virtual Serial Port with C++ under Windows 2000.
I need to design a app that creates a virtual serial port and then all the data that is sent
to that virtual serial port needs to be transformed and redirected to a serial port on this PC.
Thanx!
Dirk
|
|
|
|
|
How do i convert a "unsigned char[8]" 8 byte array to a long. Please help. Many thnx in advance.
|
|
|
|
|
|
thnx for the reply, but that's not exactly what i'm looking for. I solved it by using a union.
union x
{
unsigned char[8] ucaByteArray;
double d;
};
Because it's a union, they share the same address space, which means the content of all the 8 element can be accessed directly by the double. This is precisely what i want, and it works great.
|
|
|
|
|
hi all,
i want to show a web page in a dialog box..i dont know what control to be used and how it should be done...I will be thankful for all suggestions and pointers..Please help me...
thanks in advance..
Himanshu
|
|
|
|
|
|
Hi,
If you are using VS.NET you can use CDHtmlDialog class.
The CDHtmlDialog class is used to create dialog boxes that use HTML rather than dialog resources to implement their user interface. CDHtmlDialog can load the HTML to be displayed from either an HTML resource or a URL.
CDHtmlDialog can also do data exchange with HTML controls and handle events from HTML controls, such as button clicks.
|
|
|
|
|
Hallo,
how can I create an extra new Button, or more than one Button next to the minimize/maximize-Buttons on a SDI-Dialog Frame for Windows ?
I'am using Visual C++ 6.0 / 7.0
Has somebody a solution, or a good method to do this ?
Thanks.;P
|
|
|
|
|
I know I've seen articles which custom draw the title bar and add extra buttons. Have you searched the articles here at CP and at codeguru.com?
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Do a search for the custom caption classes written by David Lorde. That article should do what you need. I think its his only article on CP.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
i need to unzip zipped file programmatically.
i have an example, but it is too complex to be analyzed.
hope get an easy example.
thx
includeh10
|
|
|
|
|
hi all,
I am getting a very strange problem with my internationalization code.I have made a dialog based application,and i want to load all the resources according to the locale selected by the user from menu.So i have to load all the resources at run-time according from the locale specific dll.Everything like menus etc. are working well.The problem is coming in loading the dialog itself at runtime,i have specified that this is a dialog based application.So can i change the dialog at run -time,in this case,and/or can i load the dialog button at run-time from either exe or dll???????????
|
|
|
|
|
MSDN->contents->Books->Developing International Software for Windows 95 and Windows NT.
The newest release of this book is also available for purchase online.
There are also some tutorials on codeproject on internationalization.
I hope this helps.
Trust in the code Luke. Yea right!
|
|
|
|
|
Thanks to Rohit and John,
for their valuable help.
|
|
|
|
|
Take a look at CDialog::InitModalIndirect() and then go from there.
Regards,
Rohit Sinha
Do not wait for leaders; do it alone, person to person. - Mother Teresa
|
|
|
|
|
5-3 error LNK2019: unresolved external symbol "public: class ostream & __thiscall ostream::operator<<(char const *)" (??6ostream@@QAEAAV0@PBD@Z) referenced in function _main
5-3 error LNK2001: unresolved external symbol "class ostream_withassign cout" (?cout@@3Vostream_withassign@@A)
5-3 fatal error LNK1120: 2 unresolved externals
I’m using vis studio.net
I’m in my second quarter of C++
I must have accidentally done something, because it worked before, but not it won’t even do the simplest of programs.
#include <iostream.h>
void main(void)
{
cout<<"Hello";
}
Is there a way to fix the library or reinstall what ever?
or, and better, is there a good book to use to do this by myself
Thanx
|
|
|
|
|
If you choose New Project and Win32 Project and run it.
Does it work then?
jhaga
|
|
|
|
|
It should be:
#include <iostream.h>
Hope this helps!
|
|
|
|