|
I’m trying to cal the function CreateProcessWithLogonW() who has the parameter LPCWSTR lpDomain to give the domain name. I got the current domain name in a CString variable. My problem is to convert the CString domain name to the LPCWSTR domain name to cal the function.
I have tried to use the TEXT() macro and #define UNICODE to convert the CString to an unicode string, but I cant get it to work. Is there any one that can help me with this?
|
|
|
|
|
|
Hello all
I'm new to doc/view architechture. I want to create a simple text editor which have to enable me to enter text, open files, edit,cut and copy. I'm using MFC AppWizard and accepting the defaults. It's creating a basic skeleton and when I ran it it show's up a simple editor, but when I open a file it's not showing the contents. Similarly its not allowing me to enter anything.
When creating the application if I change the base class of myview to CEditView then I'm able to do all the above operations. But I want to implement all the functionality just by deriving from CView.
Can anyone help me in this regard? Any example code or article which explains how to do will be of great help.
Thank you very much for your help.
Hari.
|
|
|
|
|
To create just a text editor using CView will require alot of (unnecessary) work! If that's actually all you you want to do then use CEditView (as you suggested) or CRichEditView when creating the application in the wizard. If your problem is actually that you wish to display graphics as well, then the CRichEditView will take care of that too.
Otherwise, take a look at some of the examples here on Code Project: there are many that show you how to over ride "OnPaint", which is what you're going to have to do if you wish to manually code to at least display text in a CView.
Another method (not necessarily the best: you need to be more specific as to your problem) is to write text / draw to a bit map and then simply display that in the CView. Search for "double buffering", "bitmap" or "graphics" in Code Project. "Code Guru" is another good site to try.
|
|
|
|
|
Hello Clevedon_Peanut
Thanks you very much for the reply. I'll try for samples in codeproject and codeguru.
Thanks
Hari.
|
|
|
|
|
How to set a web proxy in a CHtmlView based SDI program? What's more, i do not want to change the IE's proxy settings.
Another question is I overloaded the OnDownloadComplete function, but if the destination page contains more than one forms, the function works as many times as the count of forms. How could i make the function work only when everything on the web page has been downloaded?
H... I... & i
|
|
|
|
|
Hi all,
I am developing a container application using MFC. The AppWizard generted code is working fine, almost for all OLE objects. But in my case the the scenario is that i have some BYTES in hand, so using those bytes i am suppose to load that object in container. I used the API's CreateILockBytesOnHGlobal() and StgOpenStorageOnILockBytes() to prepare the IStorage object. It is preparing the IStorage object, but problem is that after CoCreateInstance() i want to launch local server using OleRun() and this is not launching the local server.
(AppWizard generated code does the same thing, i want to do it manualy)
Any body please tell me why is that local server is not launching
Thank in advance
Vishal More
|
|
|
|
|
I want to use CSocket. but when i called Create() function, it always return 0, i gave the following code fragment here.
what is the wrong? did i do any mistake? Help is needed. if you can provide me sample code i will be happy.
CSocket serverSocket, clientConnection;
if(!serverSocket.Create(4001)){
m_StaticText.SetWindowText("Server Create error...");
return;
}
if(!serverSocket.Listen()){
m_StaticText.SetWindowText("Server Listen error...");
return;
}
if(!serverSocket.Accept(clientConnection)){
m_StaticText.SetWindowText("Server Accept error...");
return;
}
|
|
|
|
|
use AfxSocketInit() to intilize the socket before use socket's function. and there are some samples in the MFC, such as chatter, it would be good to you.
best regard.
laia
|
|
|
|
|
how can i check to see if
<br />
CString mydate="12/05/2004";<br />
is a Tuesday ?
cheers,
|
|
|
|
|
COleDateTime::ParseDateTime() and COleDateTime::GetDayOfWeek()
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Can anyone tell me how to add events handlers to the ScrollBar control.
It doesn't seem to generate any useable messages like Button's BN_CLICKED and Edit's EN_CHANGE. All it has is NM_THEMECHANGED.
Do i have to derive a control from the CScrollBar class and ad my own or something?
Darryl
|
|
|
|
|
Scrollbars generate WM_HSCROLL or WM_VSCROLL messages depending on thier orientation. Look up those messages in MSDN for more info.If you are using MFC check out CWnd::OnHScoll and CWnd::OnVScroll .
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Big thanx man , you've crack it for me. It was a real bugbare in my conceptuality. I wrote the app today relativly painlessly and so far it works fine.
Now i guess it's a honeymoon/getting to know MFC kind of thing for me now
Thanx again
Darryl
|
|
|
|
|
Hi.
Is there anyway I can open automatically a text document with a win32 app and diaply it in window on top?
For example you give a path name like "c:\file.txt" and it opens this file in a window. I knwo
I could create my own window and write to it but is there any shortcut for this?
I am not even sure how to do the later way too. Can you give some indications please. thank you.
|
|
|
|
|
::ShellExecute(NULL, "open", "C:\\File.text", NULL, NULL, SW_SHOWNORMAL);
Roger Allen - Sonork 100.10016
Strong Sad: I am sad I am flying
Who is your favorite Strong?
|
|
|
|
|
I made something like a HTTP server with WinSock. I managed to send html files but I have problem with sending images. There are some 0's so strings get "ended", you know...I think it could be done by sending "binary", but I don't know how to do it...
Can you give me some theory or even some code? thanx
|
|
|
|
|
Hey all.
I'm wondering if anyone can point me in the right direction (method to use...) to resize a dialog?
I don't mean if the user re-sizes it the code to put the buttons in the right place, etc... but what I do mean is I have a configuration dialog that accepts some values one time (such as registration code). After you've entered this in, it stores the registration code in an ini file. When I call oninitdialog, i read that ini file, check the registration code, and I've been using GetDlgItem(IDC_REGISTRATION_CODE)->ShowWindow(FALSE); and that gets hides the registration code box from the dialog. All of the registration information is at the bottom of the dialog. What I'd like to be able to do is when I init the dialog, if the registration code is intact, I just want to shorten the verticle size of the box (because now, it's like 2" of blank space at the bottom and looks really ugly).
I've been reading articles and found classes that handle "When a user resizes" to position controls in different places, etc, but I can't find something that will just allow me to resize the actual dialog on my own.
Any help is appreciated.
|
|
|
|
|
Look at the declaration of SetWindowPos()
Greetings,
D.
|
|
|
|
|
Got it working perfectly with that! Thanks a lot!
|
|
|
|
|
I have a function in CDocument file which I declared inline. When I call it from CView class, the linker reports LNK2001 error. If it's not inline then it works fine. Does anyone know what might be the problem?
|
|
|
|
|
dart13 wrote:
Does anyone know what might be the problem?
Are you declaring a function inline that you have overridden from an MFC class CDocument? Just a wild guess. Does the link error give any other info?
Happy Programming and God Bless!
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
The function is a member function of derived CDocument class, and I use it to access protected member variable which I created. If it is used within CMyDoc then it's ok, but when I call it from CMyView then the linker reports that error.
Here is a full text of the error msg:
<br />
MyVew.obj : error LNK2001: unresolved external symbol "public: bool __thiscall CMyDoc::IsButtonPressed(void)const " <br />
(?IsButtonPressed@CMyDoc@@QBE_NXZ)<br />
|
|
|
|
|
|
isn't the inline keyword made for declaring a function inline, wherever the code is written ?
TOXCCT >>> GEII power
|
|
|
|