|
|
I've been searching forever on this one! Does anyone know how to change text formatting for text in a loaded HTML page using CHTMLView? I'm trying to add a strikethrough to links that I have identified as invalid based on prior surfing. Any ideas?
|
|
|
|
|
Is anyone familar with MSBNx Bayesian Networks, created at Microsoft Research. I have correctly imported the Activex but I get an error here which are arguements into the api function.
<br />
<br />
#include "stdafx.h"<br />
#include "bn.h"<br />
#include "bnDlg.h"<br />
#include "models.h"<br />
.....<br />
void CBnDlg::OnButton1() <br />
{<br />
CModels model1;<br />
model1.Add("jps", "C:\\belief.xbn", "C:\\error.log", ine_Default, recommendtype_Default);<br />
<br />
}
C:\Backup2\projects\bn\bnDlg.cpp(178) : error C2065: 'ine_Default' : undeclared identifier
C:\Backup2\projects\bn\bnDlg.cpp(178) : error C2065: 'recommendtype_Default' : undeclared identifier
I
Add (Models)
http://www.research.microsoft.com/adapt/MSBNx/msbn3/Methods/Add-Models.htm[^]
http://www.research.microsoft.com/adapt/MSBNx/faqs.aspx[^]
all of the example code from MS is in VB
"obe wan, your my only hope"
Later, JoeSox www.humanaiproject.org
my friend's Hawaiian Art :
http://www.cafeshops.com/coolroxart
|
|
|
|
|
Hi all,
I implemented CToolTipCtrl in a custom control. It work fined in debug mode but the tooltip doesn't come out after I compile to exe.
Anyone encounter the problem before and I would be very grateful if you share your opinions. Thanks. ^_^
|
|
|
|
|
Could anyone help me figure out how to use the SAPI 4 PhraseParse function? I can't find any helpful info in MS's documentation and other that I don't know where else to look. Thanks!
|
|
|
|
|
Hi,
In my MFC app I need to read and write to a file. Write now I am working on the writing part of it all. I can write to a file that doesn't exist, but when the file does exists it always overwrites the contents of the file.
I am using the following code:
CStdioFile f;
f.Open("test.txt",CFile::modeCreate | CFile::modeReadWrite | CFile::shareDenyWrite, NULL);
f.WriteString(temp);
f.Close();
temp is just some string that the user enters.
Can anyone tell me what I am doing wrong, and tell me how would i get it to append to the end when the file exists already? Is there a better way to do this?
|
|
|
|
|
Put this in the pot and see if it boils:
<br />
f.Open("test.txt",CFile::modeCreate | CFile::modeNoTruncate | CFile::shareDenyWrite, NULL);<br />
Also, are you sure you need "modeReadWrite"? I doubt you'll ever need that for CStdioFile.
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
Hi,
I'm trying to make an Instant Messenger-program for my school. I'm building a client in C++ and I've made a protocol and some other things, but I really don't know what's the best option for a server.
Can I do something in combination with SQL or... Anybody got suggestions? The server has to verify the user and send his/her status to everybody else etc. etc. It also has to hold a bit of user-information and if it's possible also keep offline messages.
I've been searching for solutions, but most 'new' Instant Messengers are multi-messengers and use known protocols/servers like ICQ/MSN/AOL/etc.
Please can anyone help me?!
Best regards, Jesper.
|
|
|
|
|
Caveat : The following is just one suggested method out of many. I admit there are other 'better' methods - I am aware of them and not interested in hearing about them.
(yes i'm in a pissy mood that will likely be reflected here)
Break the project into milestones.
You want to get to something that compiles and does something as soon as possible.
From there you can incrementally add features.
Milestone 1 : Define database schema
- gather user requirements, for you this can be accomplished by creating a mockup of how you want the client app to behave on paper or a whiteboard.
- from this you can get the user defined data that you will need to persist (i.e. offline message table)
- from the user defined data will follow some of the system data you will need to store to support the client app and user data (e.g. user account table)
Milestone 2 : Client GUI
- create the client app project and build the GUI with menu, toolbars, and view windows as appropriate.
At this point you don't get to take a break, any VB programmer could get this far, keep going.
Milestone 3 : Database access
- http://www.codeproject.com/database/[^]
- pick a RDBMS e.g. Access, SQL Server, mSQL, Postgres, ... and mock up your tables and populate with some test data (e.g. 3 users, 2 offline messages).
- you'll want to use something that wraps ODBC, OLE DB, or ADO to access the database. I use class' that wrap ODBC (and OLE DB on WinCE) but the current trend seems to be ADO (which wraps OLE DB).
- use the database class' in the client app to directly insert/update/delete records.
At this point your database is defined and has test data, your data access logic has been worked out, and you have a working client app, - take a 5 min break and have a beer, you've earned it.
Milestone 4 : Create server console app
- Len Holgate has written a good series on writing a socket server class. http://www.codeproject.com/internet/[^]
- use Len's code to learn about IOCP
- define/implement your protocol
- create a console based exe for the server code, move the database access code from the client app to the server app.
- modify the client app, replace the database access code with the client socket w/ protocol class.
At this point you can see the finish line, you have a working client/server application - take a 10 min break and have a bottle of Jack, you've earned it.
Milestone 5 : Convert server from console app to registered service
- for debugging it is much easier to have the server written as a console app
- check out services in http://www.codeproject.com/system/[^]
- create server class and take current console main() and stuff into server class Run() method.
... you're done, you've wasted a couple hours of your life reinventing the wheel, but hopefully you've learned a fair bit in the process.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hi Chris,
Thanks for your reaction, even though you where a bit...
The first 3 Milestones won't be a big problem, only a bit of a sweat. I know a lot about SQL, so I would prefer to use that.
4 and 5 will be a lot of learning I guess, but that's no problem(I hope). Thanks again, also for the links, very useful!
Jesper
PS. Have a beer on me.
|
|
|
|
|
Jesper,
The database options I was suggesting were intended to contrast using a standardized API vs using a RDBMS lib API directly. I'm guessing we are arguing semantics here but SQL is the data manipulation language and not an API used to connect/control a database. So when you say you want to use SQL I/we think "what other rational choice is there", the question we would ask is "what API am i going to use to connect to a database ?" e.g. ODBC, OLE DB, ADO, through which SQL commands are passed to manipulate the database.
The networking will likely be the biggest learning curve - depending on what model you use for your server. I would really suggest IOCP, just because you can create a set of base class' now that you can use in all future server projects. IOCP allows the most scalable server model (currently available on Win) to be developed. However, it does require mutlithreaded development which opens its own can of worms.
The service stuff is cake. Shouldn't take more than a day or two to get upto speed and convert the console server app over to a service.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Okay,
I found a few examples;
http://www.codetools.com/internet/chatclient.asp?target=iocp
http://www.codetools.com/internet/chatserver.asp?target=iocp
Also a couple of other ones which I can use to learn a few things.
The DB-scheme is finished, more or less. Still got some types where I don't know for sure what the best length will be to use. But I guess that's because my sign is scales . (made a lot of php-sites with MySQL and I always seem to have this problem!) Btw. php is easy compared to this!
The client/GUI-part is ready to go to work, only have to implement a few things, but that won't be the problem.
ADO will be the way to access the DB, found a lot of App's that where similar and using this.
Hard work, but I like it .
Thx 4 your help so far, really appreciate it!
Jesper.
|
|
|
|
|
lJesper wrote:
Thx 4 your help so far, really appreciate it!
Sounds good.
I'm travelling right now (in Toronto at the moment).
But i'll be checking in for the next week or so that i'm here.
Feel free to ask questions.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
I am wondering how to find where a certain program is loaded into memory so I can access that section of RAM and read/change/ect the data.
I do not know how to find where that program loaded itself into memory. I also don't really know how to access/change the data but I assume I can just create a pointer and move it along from the start of the memory block and figure it out from there. Which also reminds me, how can I tell the end of the memory location as well.
So I guess I need to know how to find the block(start/end) of memory that a program has loaded itself into.
I am just looking for links that show me how or explain it. But source code is always nice as well.
Thanks
|
|
|
|
|
It's the operating system who load the program to memory, not program itself. You can appoint a base address when you compile a program. System try to load program on that address, if failed, it load program by it's own rule.Access other process's memory also has it's own rule. I suggest you read about the book <<programming applications="" for="" microsoft="" windows="" fourth="" edition="">> by Jeffrey Richter.I thought there you can find the answer you want.
Thinking in difference!
|
|
|
|
|
Thanks. I do know that the OS tries to place the program first then to the program. I am just wondering if the WINAPI or something in C++ allowed for finding where a program was loaded. For example, I want to find out where Minesweeper is loaded into memory so I can try to read its memory block and figure out what tiles are bombs. That is what I am aiming to do. I will try to find that book and see if it can yeild what I am looking for... given I am not exactly sure what the code will be that I want.
Thanks again.
|
|
|
|
|
There's an MSDN article titled "Minimizing the Memory Footprint of Your Windows CE-based Program" by Douglas Boling that might give you some clues. See the "An Application's Address Space " section. I did not look to see what API was used.
|
|
|
|
|
I still cant get this frickn' CTreeCtrl to insert a line...
m_cSlidOpen->m_ctrlXMLTree.InsertItem(m_strSectionName);
Where as m_cSlidOpen is the class varible to the class that contains the tree control, m_ctrlXMLTree, (this is because the current class is doing all the parsing), my program crashes when ever it gets to this... m_strSectionName is a valid CString.
How do I fix this.. i've tried adding in TVI_ROOT and it still does this
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
Did you try something like this?
TV_INSERTSTRUCT tv_is;<br />
<br />
tv_is.hParent = TVI_ROOT;<br />
tv_is.hInsertAfter = TVI_LAST ;<br />
tv_is.item.mask = TVIF_TEXT;<br />
tv_is.item.pszText = m_strSectionName.GetBuffer(1);<br />
tv_is.item.cchTextMax = m_strSectionName.GetLength();<br />
<br />
HTREEITEM hItem = m_ctrlXMLTree.InsertItem(&tv_is);
Every gun that is made, every warship launched, every rocket fired, signifies in the final sense a theft from those who hunger and are not fed, those who are cold and are not clothed - Dwight D. Eisenhower
|
|
|
|
|
Thank you it stop it from crashing.
I tired that but now its not updating the tree control even after a UpdateData(FALSE);
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
Hi friends,
How can i handle hardware interrupts in win2k?
|
|
|
|
|
Greetings
I have a command line tool and I want to provide a GUI interface to schedule the tool to perform its job. Now the problem is how do you I invoke the Query Interface wizard thru API? I can create a test sample job using the following code but I am unable to start the wizard so that the user can set it times directly thru my app.
Thanks in advance.
ITaskScheduler * sITS;
HRESULT InitTSAPI()
{
HRESULT hr = S_OK;
_ASSERTE ( SUCCEEDED(CoInitialize(NULL)) ); // init COM
if (SUCCEEDED(hr)) {
hr = CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER, IID_ITaskScheduler, (void **) &sITS);
if (FAILED(hr)) {
return hr;
CoUninitialize();
}
}
return hr;
}
HRESULT CreateTask ( WCHAR * pTaskName )
{
HRESULT hr = S_OK;
ITask * task = 0;
IPersistFile * pFile = 0;
hr = sITS->NewWorkItem( pTaskName, CLSID_CTask, IID_ITask, (IUnknown**)&task );
if ( FAILED ( hr ))
return hr;
hr = task->QueryInterface(IID_IPersistFile, (void **)&pFile);
task->Release();
hr = pFile->Save ( NULL, TRUE);
_ASSERTE ( SUCCEEDED ( hr ));
pFile->Release();
return S_OK;
}
void main()
{
InitTSAPI();
CreateTask(L"Test Task");
sITS->Release();
}
|
|
|
|
|
Hi all
I know that in win32 access to GUI objects from another thread is a bad thing. I can't understand why...
If, for instance if have an edit box created in the main thread A
and I try to this from thread B:
EditBox.GetWindowText(...);
what can be wrong here?
the GetWindowText will send WM_GETTEXT message to the window in thread A
and thread and A will dispatch it and call control's WinProc, isn't it?
|
|
|
|
|
It's only bad in MFC, because of how MFC keeps track of the associations between C++ objects and GDI handles. If you do anything more complicated than sending a message, MFC will assert all over the place.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Ericahist updated Aug 30!
|
|
|
|
|
Can you add some more info about this?
thanks?
|
|
|
|