|
Hi, I am using a CHtmlView and I need to open a new window to the corresponding link when the new window option is chosen. I am able to make a new frame, I have put it on my CMultiDocTemplate (or something like that) and load the frame when the option is clicked. However, I don't know how to get the address of the link that was clicked on. How do I do that?
|
|
|
|
|
Hi, can ne1 help
if i had a string, mystring = "0933221212"
and i wanted to replace the first two characters "09"
with say "012" so i was left with "01233221212"
whats the best way of doing this
thanks loads
si
|
|
|
|
|
CString mystring = "0933221212";
mystring.Replace( "09", "012" );
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
thanks for the quick reply
the problem with what you sent me, is that it will replace
all occurrances of 09 with 012, i need it to replace only one
occurance of 09 which will always be the first two characters
thanks
si
|
|
|
|
|
CString mystring = "0933221212";
mystring.Replace( "09", "012" );
CString strRightPart = "012" + (mystring.Right(mystring.GetLenght()-2));
::AfxMessageBox(strRightPart);
I think it's something like this.
Best regards
Jens
|
|
|
|
|
if myString.Right(2)=="09"
{
myString.Delete(0, 2);
myString.Insert(0, "123");
}
MS
|
|
|
|
|
myString.TrimLeft(_T("09"));
myString.Insert(0, _T("123"));
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
If you want to replace the first two characters, then do this:
mystring = _T("012") + mystring.Mid(2); Hope this helps,
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"
|
|
|
|
|
hi I've just built an mfc program using visual c++ and when I run it on my pc (windows xp) is works perfectly...however, when it tried running it on another computer (running windows me)..it started giving a bunch of errors (kernell errors for example)...Can you PLEASE give me some ideas on what the problem can be..are there any incompatibilities between programming for xp and me..I know that i've not given enough information about my code but any help is welcomed
thanks
|
|
|
|
|
Did you just do a copy of the exe to the WinME computer? Because you will need to be sure the right MFC dlls are on the computer on which you run the MFC app.
-Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
It would help if you cut-and-paste the errors into your message.
The Number 1 reason something works in XP/NT/2000 and not on 95/98/ME is because the application is UNICODE and Windows 95/98/XP doesn't support UNICODE properly. To you compile your application for both 95/98/ME AND XP/NT/2000, choose the 'Win32 Release' build configuration not the 'Win32 Unicode Release' (or anything with Unicode in the title).
-Fistboy
|
|
|
|
|
hey guys,
i've seem to have one problem with 'InnoSetup' ( a program creating setups).
I've added to script that install has to make a desktop shortcut. After install, i open the shortcut. The program launches.
But then i get an error (error opening database file).
'Can not find c:\..\desktop\....db' file
The program searches in the directory where the shortcut is made!
It needs to search the database file in the same directory where the program executable really is (not where the shortcut is).
The same happens when i open the shortcut on start-menu. It searches the database files where the start menu group is located at.
The strange this is .. if i make a shortcut from my program to the desktop, i don't get this error and program is executed correctly.
Anyone who can fix this problem?
Greetings
Jens
|
|
|
|
|
I had exactly the same problem as you do. When the program runs from the start menu for some odd reason it thinks that the current running directory is the desktop (or the path the desktop ini file). To fix this problem you need to do the following:
LPTSTR szCmdLine;
szCmdLine = ::GetCommandLine();
CString strPath( szCmdLine );
int iCharPos = strPath.ReverseFind( '\\' );
strPath.SetAt( iCharPos, '\0' );
for( int j = 0; j < strPath.GetLength() - 1; j++ )
{
strPath.SetAt( j, strPath[j+1]);
}
if(!::SetCurrentDirectory( (LPCTSTR)strPath ) )
This problem is not innosetup related.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
AFAIK you have to set the working (start in) directory for the shortcut.
In the [Icons] section, set the directory in the WorkingDir entry. See your InnoSetup help files for more info.
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!
|
|
|
|
|
AFAIK you have to set the working (start in) directory for the shortcut.
In the [Icons] section, set the directory in the WorkingDir entry. See your InnoSetup help files for more info.
PJ Arends, it is not possible to set a working directory because the user can specify the directory himself.
Or am i misunderstanding?
<edit> I think this is a innosetup related problem because, if the user himself makes a shortcut to the program the program will be launched correctly
|
|
|
|
|
JensB wrote:
I think this is a innosetup related problem because, if the user himself makes a shortcut to the program the program will be launched correctly
I don't think that this problem relates to InnoSetup at all because I had to deal with this problem when I used InstallShield and Windows Installer.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
ah ok. I'll try that code out that you have provided me.
I'll let you know when it worked
|
|
|
|
|
YIHA
it works great!
Thanks alot Toni for helping out. :->)
|
|
|
|
|
JensB wrote:
Thanks alot Toni for helping out. :->)
You are welcome.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
JensB wrote:
PJ Arends, it is not possible to set a working directory because the user can specify the directory himself.
Or am i misunderstanding?
You are misunderstanding. You set it to {app} which is where the user selected the application to be installed.. See the documentation on that PJ suggested.
John
|
|
|
|
|
PJ Arends wrote:
In the [Icons] section, set the directory in the WorkingDir entry. See your InnoSetup help files for more info.
You are so right. Sorry but I didn't really read your message and I wrongfully insisted on my answer.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
hi there
i have a problem...
i added a lib (+ description header file) to my test project ... ( cwinapp + own editet cdialog ) all works fine ...
but when i try to add a declare_message_map and a begin_message_map the dialog wont be shown anymore...(but it works without problems when using a windowproc...)
can it be that there is a problem in the lib/header?
(perhaps its a common problem and all of you know what im talking about? )
|
|
|
|
|
Hi
If you have implemented a new dialog (a child of CDialog) with the functions from the Visual Studio, you have in this dialog-class a message_map and you don't must implement a new message_map.
For Windows messages use the class-wizard to create the handle-functions e.g. OnCreate() for WM_CREATE (see below in the message_map -> ON_WM_CREATE())
For your own messages use the macro ON_MESSAGE in the excisting message_map
e.g.
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
ON_MESSAGE(WM_OWN_MESSAGE, MyOwnFunction)
//{{AFX_MSG_MAP(CMainFrame)
ON_WM_CREATE()
.....
END_MESSAGE_MAP()
If your dialog complete without MFC, use the windowproc()-function
Regards
Frank
|
|
|
|
|
Hi Guys!!
I want to check Internet connectivity on my machine. I`ve reproduced my code below.
The code works fine except if IE is in offline mode.i.e i am unable to detect offline mode..
#include "stdafx.h"
#include "Wininet.h"
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
BOOL bConnected = FALSE;
DWORD dwFlags;
bConnected = InternetGetConnectedState ( &dwFlags, 0 );
if ( bConnected )
if ( dwFlags & INTERNET_CONNECTION_OFFLINE )
bConnected = FALSE;
if (bConnected )
MessageBox(0,"WOW ! Internet is Connected !","",0);
else
MessageBox(0, "Oops ! Internet is not Connected !","",0);
return 0;
}
Regards!!
Abhi
P.S Tony, Ryan please have a look.
|
|
|
|
|
Isn't bConnected false when InternetGetConnectedState returns? What is the return value?
Let's ignore bConnected for a moment.
Change these lines:
if ( bConnected )
if ( dwFlags & INTERNET_CONNECTION_OFFLINE )
bConnected = FALSE;
to:
if ( dwFlags & INTERNET_CONNECTION_OFFLINE )
bConnected = FALSE;
and tell me what happens. What is the value of dwFlags?
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|