|
At me some libraries are not created for VC.NET!
Whether I can establish VC.NET and VC ++ 6.0 simultaneously?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Eugene Pustovoyt wrote:
Whether I can establish VC.NET and VC ++ 6.0 simultaneously?
Yes.You can.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Thank you Mazdak!
Best regards,
Eugene Pustovoyt
|
|
|
|
|
If the libraries use STL, you might run into some problems as STL is different between 6 and .NET.
Michael
Communication is the first step towards enlightenment.
|
|
|
|
|
Thank you Michael!
Best regards,
Eugene Pustovoyt
|
|
|
|
|
In VC6 there was an option to show all the keyboard binds. Does that exist in VC7?
Todd Smith
|
|
|
|
|
Is this what you're looking for?
Tools->Options->Environment->keyboard
I don't see a way to see the bindings listed by key. Instead they're listed by command.
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
|
|
|
|
|
There is an addin called KeyMap available here
Click here
There are lots of other useful addins
Rama Krishna.
Also known as Master of VS.NET
|
|
|
|
|
Rama Krishna wrote:
Also known as Master of VS.NET
This is exactly what I was going to call you and then I saw your sig! Great links and thanks!
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
|
|
|
|
|
I have come unstuck trying to do some basic file saving stuff. I want the user to be able to open a file, and then save the filepath for prosperity. The code below works sometimes. When it works it will overwrite the existing file or create a new file (if none exists already) and write the correct path. More often then not though it will not write to file. I have confirmed that it is retrieving the correct filepath each time.
CFileDialog* fdlg;
CStdioFile* file;
// Construct file to write to
file = new CStdioFile();
file->Open("test.dat", CFile::modeCreate | CFile::modeNoTruncate | CFile::modeReadWrite);
// Construct open file dialog
fdlg = new CFileDialog(TRUE);
fdlg->m_ofn.lpstrTitle = "Open Database";
fdlg->m_ofn.lpstrFilter = "MS Access db (*.mdb)\0*.mdb\0\0";
if (fdlg->DoModal() == IDOK)
{
file->WriteString(fdlg->GetPathName());
}
file->Close();
I have been tearing my hair out now for about 30 straight hours so I will sing the praises of anyone who can help (even a little).
Cheers big ears
|
|
|
|
|
#include <iostream>
#include <fstream>
std::ofstream file("test.dat.");
file << (char*)fdlg->GetPathName();
file.close();
You MAY need to get out the CString pathname and use GetBuffer/ReleaseBuffer to pass it to a stream, or you can write a stream handler for CString - I think an article I have on CP does this.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
<i>And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned.</i> - <b>Christopher Duncan - 18/04/2002</b>
|
|
|
|
|
In_Way_Too_Deep wrote:
file->WriteString(fdlg->GetPathName());
Make that :-
file->WriteString(fdlg->GetPathName()->GetBuffer());
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
What happens if you call GetBuffer without a size ? What happens if ReleaseBuffer is never called ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Christian Graus wrote:
What happens if you call GetBuffer without a size ? What happens if ReleaseBuffer is never called ?
In this case it doesn't matter. Because WriteString expects a LPCTSTR
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
|
Hi.
I am getting closing to completing a simple messaging program. I will use the WSAAsyncSelect I/O mode. The design is simple, but I have found a major problem. The WSAAsyncSelect is not the best I/O mode, but it is easy to implementing for MFC based applications.
WSAAsyncSelect uses the winproc as a way to update the program about sockets including send, receive, close, accept, etc. So basically, the WSAAsyncSelect I/O mode turns an otherwise blocking socket into a non-blocking socket. It uses the WPARAM and LPARAM to store errors and data structures required to, for example, create a new socket linked to the user that is trying to connect to the server.
Now comes the problem. I declared all program data such as the socket, listening socket, sockaddr, etc. in the doc. However, WSAAsyncSelect sends a message with the WPARAM and LPARAM to main frame. I have no idea how to pass WPARAM and LPARAM from main frame to doc so I can process the data.
I see two possible solutions.
1) pass WPARAM and LPARAM from main frame to doc
2) redirect WPARAM and LPARAM from main frame to doc view SendMessage(). However, doc cannot process WM_USER message, can it? I cannot find the SendMessage() for doc.
Please post if you have a working solution for the WSAAsyncSelect I/O mode.
Thanks,
Kuphryn
|
|
|
|
|
Store the pointer to your document class in a member variable of CMainFrame. Now you can access all the CDocument members you've added, from the main frame class.
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Thanks.
Oh oh. MFC and Winsock is only beginning to get interesting. If I have pointer to doc, that would break the OOP encapsulatiion standard, would it not???
Kuphryn
|
|
|
|
|
Okay. I believe I have a solution. However, I am debugging another problem, so I am not completely sure that the solution works.
The solution I implemented compiled, but I have not fully tested it. The solution is to pass the a reference of wParam to doc.
I like this solution because I do not have to use a pointer to doc just to access its private data. This solution keeps the OOP encapsulation standard intact.
Kuphryn
|
|
|
|
|
I'm making a MFC dialog based program and I would like to change between two different bitmaps in a picture box. I assigned a static control to it and found a function called SetBitmap(HBITMAP hBitmap). Is this the right one? And if I want to change it to a resource bitmap how should i do? It's called IDB_BITMAP.
|
|
|
|
|
tordyvel wrote:
Is this the right one?
Yup.
tordyvel wrote:
And if I want to change it to a resource bitmap how should i do? It's called IDB_BITMAP.
HBITMAP hNewBmp = static_cast<HBITMAP>(::LoadImage(AfxGetResourceHandle(),
MAKEINTRESOURCE(IDB_BITMAP), IMAGE_BITMAP, 0,0,
LR_DEFAULTCOLOR|LR_SHARED));
--------
Higher education helps your earning capacity. Ask any college professor. --Shog9 --
|
|
|
|
|
It didn't work... i get this error:
error C2059: syntax error : '('
...don't really know what to do
|
|
|
|
|
It looks like the formatting on Shog9's response was mangled, here is what you need.
HBITMAP hNewBmp = static_cast<HBITMAP>(::LoadImage(AfxGetResourceHandle(),
MAKEINTRESOURCE(IDB_BITMAP), IMAGE_BITMAP, 0,0,
LR_DEFAULTCOLOR|LR_SHARED));
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
<shog slaps self>
Sorry, forgot to escape the angle brackets (again). Thankfully kilowatt came to the rescue
--------
Higher education helps your earning capacity. Ask any college professor. --Shog9 --
|
|
|
|
|
How do you put a new line in a CString? "\n" doesn't seem to work
|
|
|
|