|
or better way to use
ShellExecute
ShellExecute(NULL,"open","Notepad.exe","filename.txt",NULL,SW_SHOWNORMAL);
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
"C:\\MyFile.txt >> Notepad.exe" does not work. Use the following:
CString l_cstrApp = _T("C:\\WINNT\\Notepad.exe");
CString l_cstrCommandToLaunch. = _T("C:\\WINNT\\Notepad.exe c:\\file.txt");
ARSALAN MALIK
|
|
|
|
|
OK ! Now It works!
Thanks a lot to all.
|
|
|
|
|
I want to make a program that administrates some computers in a network and I need to do a client server aplication. The computer server has a server program which accepts connections from the computers in the network. After a computer connects i create a thread for that certain socket and ip.
In order to send info to a computer so I can reveive something I have to do it in that thread so I need some way of storying some string variables somewhere from where they can be read. I don't think registry would be a good idea because I did this and after a while the registry fails to open the certain key I don't know why . . . I know it can be done with some mutex objects or something like this. Can someone give me a piece of code on how variables can be read.
Thank you.
gabby
|
|
|
|
|
I want to use API TransmitFile to build a C/S structure ,who can give me an example.I have written a program but client program has bug,client codes as below:
UINT ClientThread(LPVOID lv)
{
SOCKET s=(SOCKET)lv;
CFile f;
bool IsOpen=false;
char buf[1024*128]="";int count=0;
while (true)
{
buf[0]='\0';
int ret=recv(s,buf,sizeof(buf),0);
if(SOCKET_ERROR == ret)
{
CString s;
s.Format("%d",WSAGetLastError());
AfxGetMainWnd()->SetWindowText(s);
break;
}
else
{
CString str(buf,ret);
int i=str.Find(':');
if(-1 != i)
{
if(f.Open(str.Right(str.GetLength()-i-
1),CFile::modeCreate|CFile::modeWrite) == 0)
break;
IsOpen=true;
}
else if("FileTranferOver" == str)
break;
else if(IsOpen)
{
try
{
f.Write(buf,ret);
}
catch (...)
{
str.Format("%d",GetLastError());
MessageBox(NULL,str,"Error",MB_OK);
}
}
else
continue;
count+=ret;
}
}
if(IsOpen)
f.Close();
CString str1;
str1.Format("%d",count);
AfxGetMainWnd()->SetWindowText(str1);
return 0;
}
|
|
|
|
|
I am having a MFC Dll.
The settings are as follows
Use MFC in a Static Library
In Code Generation : Debug Mutithreaded DLL.
The error i am getting is
uafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___wargv
uafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
But when i change the Code generation option to
Debug Multithreaded,
i dont get any Link errors.
What is the difference and is it OK to have this option for a MFC dll.
Yuvaraj N
|
|
|
|
|
in my app, i resize property sheet to max size (SW_SHOWMAXIMIZED), but when i resize property pages of the sheet, they are not resizable.
do you know how to resize property pages??
thx
includeh10
|
|
|
|
|
Paolo Messina has written an article on this
http://www.codeproject.com/property/resizableproperties.asp[^]
Boiled down to basics, what you do is in your property sheet's OnSize handler is call GetTabControl() to get the tab control, resize the tab to the size you want, then call CTabCtrl::AdjustRect to get the size of the tab's client area. Then resize the active page to that area.
void CMySheet::OnSize(UINT nType, int cx, int cy)
{
CTabCtrl *pTab = GetTabControl();
CRect rc;
GetClientRect(&rc);
pTab->MoveWindow(rc);
pTab->AdjustRect(FALSE, &rc);
GetActivePage()->MoveWindow(rc);
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
it works well!
thx
includeh10
|
|
|
|
|
Which control is behind the function of offering a selection of options usually when right-clicking on whatever? Like function Open, New, Copy, etc.
I do not mean menus. For example on the VC++ screen, if I right-click on a code line, I receive the list of selections "Cut, Copy, Paste, Insert File into Project, Open Document, List Members,...".
|
|
|
|
|
This can be done using the CMenu class (CMenu is not only for menus under your title bar). Check the TrackPopupMenu function for more details...
|
|
|
|
|
Thank you Cedric, this is just what I wanted; it works fine.
|
|
|
|
|
Hi all !
I was assigned a task which I don't think is possible to do.
What I was requested to achieve is basically the following:
To cause our existing MFC (Doc/view) application to become a COM EXE server !
Is it possible at all, or am I wasting my time. If it's not possible, what approach shall I take?
I used the information which appeared under the article :
Article ID :175190
Last Review:June 29, 2004
Title : How to add ATL support to an MFC EXE
Link : http://support.microsoft.com/default.aspx?scid=kb;EN-US;175190[^]
Outcome so far : NOT Successful, meaning, the registration is not failing, but the server cannot be found by a client application (class not registered !)
As far as I understand , the article 175190 discusses the option of
embedding an "local In-process COM server" into the application, not a "remote COM EXE server".
I tried everything I know, so far with no results..
Please help,
Rubi
|
|
|
|
|
I would not try to convert an existing project. More I would take the core functionality out of the existing MFC application and add it to a new COM Server project.
Doing this you can then call the new COM server routines rather than the existing routines from your application to see if it behaves as expected.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Found the bug which was causing this not to work,please go to for in depth info :
http://www.codeproject.com/script/comments/forums.asp?forumid=1648&exp=0&select=986387#xx986387xx
Rubi
effic
|
|
|
|
|
Does anyone have an example of how to make a simple opengl32.dll? I want to catch application usage of glBegin(). So my dll must intercept the normal opengl call, keep a counter of the number of glBegins, and then call the real opengl glBegin().
I tried API highjack, but this will not work if the application loads the opengl library dynamically at runtime using LoadLibrary.
Thanks,
Max
|
|
|
|
|
use the win32 disassembler, and check the box for 'break on api calls'.
int i = 2, x = 2;
int j = x + y;
sprintf("%d",j);
4.7388937 ???
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
I made an application to browse html pages off a website. Then they added a registration requirement to the site, i.e. you need to log in every time, and I haven't been able to access their pages since. I use CInternetSession::GetHttpConnection passing the host name and login information. Then I call CHttpConnection::OpenRequest, and CHttpFile::SendRequest and read from the resulting CHttpFile object. This allowed me to display html pages in the past, but now with the login I get a 0 byte file. I think the username and password just aren't getting through, but I don't get an "access denied" html page, just a 0 byte file. Any idea what's going on and what I should do? Thanks for any help!
The relevant code is :
CInternetSession session;
CHttpFile* file = NULL;
CHttpConnection* hc = session.GetHttpConnection(Host,80,Uname,Pword);
file = hc->OpenRequest(NULL, urls[iterate], "", 1, NULL, NULL, INTERNET_FLAG_EXISTING_CONNECT );
file->SendRequest( "", 0, NULL, 0 );
|
|
|
|
|
HI,
I want to store a value in a variable
Value is 10** - 17
wt type of a variable is require.
how i will write the statement.
thanx
Regards.
|
|
|
|
|
zahid_ash wrote:
Value is 10** - 17
CString czVar = _T("10** - 17");
Urhmm
What is : 10** - 17 ?
Your question is a little too cryptic for me maybe.
I Dream of Absolute Zero
|
|
|
|
|
Hi,
I am cmpiling a project that is developed in Visual C++ 6.0 with SP5 on Windows 2000(SP4)
I am compiling in Visual C++ 6.0 without any service pack on Windows XP and it is giving me error
c:\program files\microsoft visual stu:(dio\vc98\include\unknwn.h(343) : error C2143: syntax error : missing ',' before '*'
c:\program files\microsoft visual studio\vc98\include\unknwn.h(343) : error C2259: 'IUnknown' : cannot instantiate abstract class due to following members:
c:\program files\microsoft visual studio\vc98\include\unknwn.h(106) : see declaration of 'IUnknown'
c:\program files\microsoft visual studio\vc98\include\unknwn.h(343) : warning C4259: 'long __stdcall IUnknown::QueryInterface(const struct _GUID &,void ** )' : pure virtual function was not defined
c:\program files\microsoft visual studio\vc98\include\unknwn.h(109) : see declaration of 'QueryInterface'
c:\program files\microsoft visual studio\vc98\include\unknwn.h(343) : warning C4259: 'unsigned long __stdcall IUnknown::AddRef(void)' : pure virtual function was not defined
c:\program files\microsoft visual studio\vc98\include\unknwn.h(113) : see declaration of 'AddRef'
c:\program files\microsoft visual studio\vc98\include\unknwn.h(343) : warning C4259: 'unsigned long __stdcall IUnknown::Release(void)' : pure virtual function was not defined
c:\program files\microsoft visual studio\vc98\include\unknwn.h(115) : see declaration of 'Release'
c:\program files\microsoft visual studio\vc98\include\unknwn.h(343) : error C2059: syntax error : '*'
I think unknwn.h is internal file of Visual studio.
I searched on microsoft site and list of bugs removed in SP5 donot include errors listed above.
Can anyone please tell the reason ?
Any suggestion will be appreciated
Rits
|
|
|
|
|
Rits Kwatra wrote:
I searched on microsoft site and list of bugs removed in SP5 donot include errors listed above.
Yes, but any SP updates may indirectly fix your problem. Personally I would not develop any VC6 application without first updating to SP5 as it has solved a few issues I'd had before.
So do not underestimate the impact that a Service Pack can have. Also, since you are porting to XP, you should download and install the latest Windows SDK. I have the Feb 2003 install. The one that came with VS6 is just way out of date!.
I Dream of Absolute Zero
|
|
|
|
|
I reinstalled the visual studio and now it is working fine. May be some files was corrupted
Rits
|
|
|
|
|
Hello everyone, i'm looking for good region clipping algorithms, like you can see for example in XARA. Where can i find good sources of such algorithms? I worked with CombineRgn - this was not what i looked for, it clips regions with load of rectangular things. And what will happen if i clip the ragion like E with region like O. Really i have to get more than 3 different regions - so, i hope you'll understand me
Thanks...
|
|
|
|
|
Have a look at gpc (General Polygon Clipper)[^]. It should do exactly what you need (and probably more)
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|