|
I'm writing an editor, and I want to have current Line and Column displayed.
Line is working fine, but column doesn't always work right.
if I try to get the CharIndex of the beginning of the line this way,
long int nStartChar = SendMessage(EM_LINEINDEX,-1,0);
I eventually hit a problem after 88x lines, where (nCurrChar - nStartChar) is 65xxx
if I try to get the CharIndex of the beginning of the line this way,
long int nStartChar = LOWORD(pEdit->CharFromPos(ptLineBegin));
where ptLineBegin is based on GetCaretPos() and x forced to 0, then the column is based on the left of the window, and not the actual beginning of the line.
Can anyone give me some help, please? Thanks!
BW
"We get general information and specific information, but none of the specific information talks about time, place or methods or means..."
- Tom Ridge - US Secretary of Homeland Security
|
|
|
|
|
Turns out it wasn't the start of line I had issues with, it was getting a reliable Curr CharIndex.
I got it this way.
<br />
DWORD dwStart, dwEnd;<br />
pEdit->SendMessage(EM_GETSEL,(WPARAM)(&dwStart), (LPARAM)(&dwEnd));<br />
<br />
return dwStart;<br />
BW
"We get general information and specific information, but none of the specific information talks about time, place or methods or means..."
- Tom Ridge - US Secretary of Homeland Security
|
|
|
|
|
Hello
I am looking for function to stop and continue the message processing of processes.
Is there a function like StopMessageProcessing(...) to stop
a process processing its messages? This does not mean to kill its messages in its message queue, it means just to stop the processing for a certain time I want to define.
-Dominik
|
|
|
|
|
Check SuspendThread and ResumeThread
an article
http://www.codeproject.com/threads/pausep.asp
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
You might be able to use SuspendThread and then ResumeThread, but I'm not sure if you can do this cross-process. Note that you might have to suspend all the threads of the process, not just the base one.
The only other alternative is to somehow pass a particular message to the app that you have a hook into. When the message is received you would do a sleep or something that doesn't return control till you need it to.
Joel Lucsy
|
|
|
|
|
Hi!
I have inserted an activex control in my Win32 API application, and when i try to compile it, my application doesn't have any errors and it's not visible....
What's wrong?....
|
|
|
|
|
Hi !
Are you sure your ActiveX is well registered and installed (not only added to the C++ compiler)?
I had the same problem when I ran my application on a computer wher the ActiveX was not installed.
Hope it helps!
|
|
|
|
|
Is there anything equivalent to DoEvents of VB in VC++ 6???
Mahesh
|
|
|
|
|
Mahesh Perumal wrote:
Is there anything equivalent to DoEvents of VB in VC++ 6???
I would assume it's along the lines of SendMessage[^].
-Nick Parker
|
|
|
|
|
More along the lines of a non-blocking message loop;
while (::PeekMessage(&msg,NULL,0,0,PM_NOREMOVE))
{
AfxGetThread()->PumpMessage();
}
or similar
Steve S
[This signature space available for rent]
|
|
|
|
|
It doesn't exist, but you can certainly write it:
void DoEvents()
{
for (MSG msg; ::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); )
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
}
Regards,
Alvaro
Quitters never win. Winners never quit. But those who never win and never quit are idiots. -- despair.com
|
|
|
|
|
Thanx a lot.
I have got it working...
|
|
|
|
|
I program by MFC. How to write an application that can open a web site? It is wonderful if I can do that by clicking on a button.
Thank you.
|
|
|
|
|
Look at InternetOpenUrl().
You should save yourself and your company years of grief by shooting yourself through the head immediately. Believe me, in the long run it'll turn out better for everyone. - Tyto (at arstechnica)
Awasu 1.0[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Try something like:
ShellExecute( hWnd, _T("open"), _T("http://www.mywebsite.com/default.htm"), NULL, _T(""), SW_SHOW );
The parameters are described in detail in MSDN.
Dave
|
|
|
|
|
You can use ShellExecute() function with the site address as argument.
|
|
|
|
|
I use MFC to program. I wan't to make an application that can become an icon on taskbar after click on a button.
Thank you!!!
|
|
|
|
|
Call ShowWindow( SW_MINIMIZE ) on your main frame.
Dave
|
|
|
|
|
Hi,
I am using VC++ 6.0 for multile PC's that using the same MS Access database table (DAO). I am encountered with one problem as the following:
- The first user comes in a table looking for a specific record then AddNew() then Update() record on it (if it has been emptied)!
- The next user comes in later (almost at the same time) looking the same one, but instead see it is NOT EMPTY ... it see it still EMPTY then do the same as the first user
- Then I had two different records instead of only one!
*) I tried different approaches to avoid this problem but not success very well (failed every three times)! Here what I did:
1) After AddNew() & Update() ---> I Edit() that record then Update() for the next user using Requiry() for fast ReFresh ... in hopping it now can see that record is done & doing NOTHING!
2) Using another table (only one data) and let the first user set a flag to it ... until it finish Addnew() & Update() record ... delay 1 second then remove that flag. The second user only can get in the same table when that flag is not set!
3) Low approach: Using Token methode (almost same as #2), instaed wrie to a table, the first user writes a simple character to a text file with Exclusive Open, after finish AddNew() & Update() then delay one second ... it will close that file! The second user will wait untill that Token is released in order to do the same and now can use the same table which the first user already complete its task!
I hope someone knowing better ways to let the next user knowing that record is NOT EMPTY (was set by the first user) by some way very fast, or block or any thing else!
It is a desperate request, I appreciate a lot any helps or suggestion here!
Many thanks
|
|
|
|
|
This is a hard question in general. Have you tried specifing any of the options in CDaoRecordset.Open (like dbDenyRead or dbSeeChanges)?
Joel Lucsy
|
|
|
|
|
I am going to draw some polygons with borders and filled with a color. From time to time I have to draw a border around two adjacent polygons.
Any suggestions to algoritms.
I have tried making two regions and combining these but when I draw the frame it makes a frame around the polygons I like to have the border in the edge of the polygons.
thanks a lot
|
|
|
|
|
Maybe I don't understant what you mean, but have you looed at PolyPolygon() ?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I have tried, but this funktion draws the lines they have in common, i want to draw a border around the new polygon combined polygon.
Thanks anyway
Jørgeen Granbog
|
|
|
|
|
The other way to work is to consider building your polygon in reverse, by clipping out the areas that are not wanted anymore.
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
I'm guessing the concept of a 2 hour movie showing two guys eating a meal and talking struck them as 'foreign'
Rob Manderson wrote:
|
|
|
|
|
Thanks that might be a good suggestion - I looked for an algorithm. Else I will try to handle it this way.
Thanks for your interest
Jørgen Granborg
|
|
|
|