|
have you tried this?
do a SetSel(pos, pos) to position the insert, then use ReplaceSel("<br>") to insert the text
-c
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
Are you the same guy who's struggling with CEdit::ReplaceSel?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Thanks Chris.
Tomasz, I don't know who you're talking of.
|
|
|
|
|
If I got a lot of text in my EditBox, I won't get the <br> tag at the same position than if I have just like 5 lines of HTML code, am I right?
|
|
|
|
|
Hi,
there are days...
well, it works but I think there should be a better way of doing it.
my problem's like this :
I'm passing an array of char (cArray[50][20]) to a function which is declared as MyFunc(char *pArray).
with pArray I'd like to access the array-items, which it does if I increment it by 20, but then it only gives me the first character of each array-item. To correct this, I use strcpy(..) and all goes fine, but to me it looks like a really bad solution.
Someone has an idea to improve this ?
thanks
|
|
|
|
|
Typedef char [50] as a custom type (eg: MyArrayType ) and declare the function argument of type MyArrayType * .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
And here we go again :
typedef char[50] cArrayType; gives a compile-error.
nontheless thanks
|
|
|
|
|
can you use a CStringArray, or a vector of CStrings?
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
thanks for the reply.
the char-array items come from SQLBindCol(....) which wants type char. since
the database-table is about 40 fields large, I use the char array.
After getting all the items filled, I could of course write then to a CString-array but that looks as bad to me as what I've right now.
there should be a way to access the array be incrementing the pointer one step
at a time.
|
|
|
|
|
typedef char cArrayType[50];
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Great !
almost correct, but it must be cArrayType[20]
and now it works like I want it to.
thanks
|
|
|
|
|
Sorry, I assumed you knew what I meant. Try this:
typedef char MyArrayType [50];
MyArrayType myArray [20]; /ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
All-
I just joined this site, because when I get error messages I am often pointed to it during a search. But, I am a virgin when it comes to code. I am getting an error "cannot initialize ressource.dll". I have not installed anything but have lost most of my right-click menu and that error will appear ONCE during every DIFFERENT action. For example: Drag & Drop error, click close and Drag & Drop works without a problem. But, if I get that error with another action AFTER Drag & Drop, then it will reappear the next time I try to drag & Drop.
I do not have ressource.dll on my system and wouldn't know what program it belongs to.
I want to "ease" my way into being able to do simple debugging and I hope this will be the place.
Thanks in advance Mike Mc
|
|
|
|
|
Problem Solved. I had a shell compression program called Iceows (formerly ARJ Folder). I had disabled the commands and that was what caused ALL of my problems.
But, here's the kicker. The error was "Cannot Initialize ressource.dll" and this program doesn't install it.
Now, I should be able to just uninstall the p[rogram completely.
Then I can lurk and learn. My 4th system and I cannot keep up with the latest codes.
Mike Mc
|
|
|
|
|
I got a sample Dialog based MFC program. I made some modifications to it, one of them is: when F1 is pressed, show the HTML help file. But when I run it, after the HTML help file was shown, a message box pop up with caption of "Windows Help", and the message itself is:
"Cannot find the S:\TRANSFER\lwang\Antialiasing\Debug\ASIST3D.HLP file. Do you want to try to find this file yourself? Yes No".
It seemed to me that the default function for accelerator key "F1" is still being invoked somewhere in the program. How can I get rid of it?
Thank you very much for any hint!
|
|
|
|
|
Have you checked the message map? Probably that - unless that's how you made your mod?
Dylan Kenneally
London, UK
|
|
|
|
|
hmm, there is a default function for ID_HELP in the App class. Getting rid of that line solves this problem. Thanks!
|
|
|
|
|
MFC translates F1 into ID_HELP command. You're invoking Html help in response to what event?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Thanks for the fast response. I'm invoking Html Help in response to menu item File->Keys. And I assign F1 as the accelerator key to this menu item.
I add the following lines to my dialog cpp in its message map declaration:
ON_COMMAND(ID_HELP, OnFileKeys)
And remove the line for ID_HELP in the App class.
Thus solved the problem.
Thank you very much again!
|
|
|
|
|
is it possible to use the RASDial Function without knowing the
szEntryName + password + username, and just connect with the
default settings to redial a lost Modem connection .
thanks
|
|
|
|
|
|
According to my experiences and some sources on the net the MFC class CSocket does not seem to be very thread-safe.
Creating the sockets (listen sockets & accepted sockets) in the main-thread and using them in another thread gives troubles...
So I tried to create all sockets in the thread function.
After calling AfxSocketInit() in the thread function (I don't know if this is correct ...) Everything seems to be fine, But the virtual functions OnAccept(), OnReceive(), ... are not called.
The attach/detach trick is not an option, because both mainthread and other thread use the sockets.
How should I handle this problem ?
Any help appreciated.
Greetings,
Niko
|
|
|
|
|
Why can you not use Attach/Detach? I use this in a multi-threaded socket app.
e.g. I have a thread that uses a socket that listens on a port. When an incoming connection arrives it creates a new thread and passes the thread the socket handle:
void CListenSocket::OnAccept(int nErrorCode)
{
CSocket socket;
Accept(socket);
CAcceptThread* pThread = (CAcceptThread*)AfxBeginThread(
RUNTIME_CLASS(CAcceptThread),
THREAD_PRIORITY_NORMAL,
0,
CREATE_SUSPENDED);
pThread->m_hSocket = socket.Detach();
pThread->ResumeThread();
}
BOOL CAcceptThread::InitInstance()
{
m_pSocket = new CServiceClientSocket;
m_pSocket->Attach(m_hSocket);
}
Faith. Believing in something you *know* isn't true.
|
|
|
|
|
We don't want to use many thread, because there will be some 10.000 connections on that server. The accepted connection is added to a pool.
1 thread polls all connections and performs some actions on the sockets.
On the same time the main thread is also able to do some interaction on some sockets.
I guess using attach/detach everytime when needed wouldn't be good idea.
|
|
|
|
|
one of my costumers has the problem that my program
is crashing when he starts up the program. he has
send me the cpu/memory adresses of the standard
warning window when a program is crashing.
how do i find the problem causing the program to crash
on his maschine with the information i have now ?
Regards
mario
|
|
|
|