|
Have a debug failure when creating a window of my COM 3d imager.
When I created my 3d imager window inside my application…
bRet = m_pSatMap->Create("Internal_DB_SAT_Map", 0, Rect, pMainFrm, ID_SAT_MEM_MAP, NULL, FALSE);
I got an assertion error from ENSURE(afxOccMgr != NULL)”. After researching this I found that this would occur when AfxEnableControlContainer() was not call. However it is in my main but not in my subclass where the Create is called. So I added it to that class, and now I have another assertion problem. Now “ASSERT(pWndCtrl->m_pCtrlSite == NULL)” is failing.
I think I’m looking for a site that speaks to how to pass afx control to classes inside an application.
Thanks for any help
Glenn
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
Does somebody has some tricks (or code) about multilanguage support ? (C++ , XML, or something else).;)
Danny Gilbert, enginneer
Montréal, Canada
|
|
|
|
|
what exactly do you want ?
i put all my GUI strings into the resource strings table, and duplicate the table for each translation i need.
in the table properties, don't forget to associate a resource language to it.
|
|
|
|
|
|
Easy question but I don't find the answer.
I have a header file with some classes. These classes used some class from one another header file.
How can I tell to compiler to use the classes from other header files ?
Extern does not work, only work on object.
Danny Gilbert
Montréal, Canada
|
|
|
|
|
dannygilbert3 wrote: How can I tell to compiler to use the classes from other header files ?
#include "OtherHeaderFile.h"
|
|
|
|
|
#include is the directive for you...
|
|
|
|
|
If you only need to declare pointers or references to those other classes, you can do a forward declaration (I believe that is what it is called) by putting code like this:
class CClass;
class CSomeOtherClass; Before the code that declare pointers/references to that class.
class CClass;
class CSomeOtherClass;
class CMyClass
{
public:
CMyClass( CClass *pClass );
CMyClass( CSomeOtherClass &socSomeOtherClass );
<code>CMyClass( CAnotherClass *pAnotherClass );</code> <code>
<code>CMyClass( CAnotherClass &cacAnotherClass );</code> <code>
}; If you need to actually access members of the class, then you need to include the entire declaration of the class (usually by including its .H file). This is usually required in the CPP file for the class that uses the other classes. Be careful throwing includes around freely if you are not fully familiar with the code, you can introduce dependency problems and/or mess up your build times.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
|
Hi all,
I do:
CFileDialog fd(TRUE, NULL, percorso, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY);
fd.m_pOFN->lpstrTitle = "Dialog Title";
Now i need a CFileDialog that shows only .txt files.
I also need another CFileDialog which i use to save a file
in which the "file type" field is .txt
How can i do that ?
Thanx in advance,
Desmo16.
|
|
|
|
|
Look up how to construct Filters for the common file dialog. The docs for CFileDialog is a good place to start.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
set the extensions filter to "Text files (*.txt)|*.txt||"
|
|
|
|
|
i tried with
CFileDialog fd(TRUE, NULL, percorso, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY);
fd.m_pOFN->lpstrTitle = "load file";
fd.m_pOFN->lpstrDefExt = "txt";
and also with
CFileDialog fd(TRUE, NULL, percorso, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY);
fd.m_pOFN->lpstrTitle = "load file";
fd.SetDefExt("txt");
but it doesn't work.
Where should i search in the doc exactly ?
|
|
|
|
|
not what i told you to do.
i said assign the string "Text files (*.txt)|*.txt||" into the filter member of the CFileDialog...
(see the 5th parameter of the constructor)
|
|
|
|
|
You are right, now i wrote:
CFileDialog fd(TRUE, NULL, "*.txt", OFN_FILEMUSTEXIST | OFN_HIDEREADONLY);
fd.m_pOFN->lpstrTitle = "Carica file di osservazioni";
fd.m_pOFN->lpstrFilter = "Text files (*.txt)";
and it works great ! Thanx !
|
|
|
|
|
yes, i modified my previous post ; you could also have done this using the 5th parameter of the constructor...
also, don't hesitate to read the MSDN[^]. it's there for you !
|
|
|
|
|
The CFileDialog has on the bottom-right
corner a button labeled as "open".
How can i change the label into "save" ?
Thanx in advance,
Desmo16.
|
|
|
|
|
i am facing a problem with the socket class in win32. when trying to link windows and unix machines in win32 the unix machine not get the information as the sockets was closed for the threads which are finished .the recieving end just waits for all the threads to finish and only after all the threads finish the sockets was considered closed. is the socket class is blocking or non blocking type.
vineesh
|
|
|
|
|
Sounds like a problem with SO_LINGER. I do not think that has anything to do with blocking or non-blocking sockets.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Maybe this will help. From the SDK...
To assure that all data is sent and received on a connected socket before it is closed, an
application should use shutdown to close connection before calling closesocket. For example, to
initiate a graceful disconnect:
Call WSAAsyncSelect to register for FD_CLOSE notification.
Call shutdown with how=SD_SEND.
When FD_CLOSE received, call recv until zero returned, or SOCKET_ERROR.
Call closesocket.
Note The shutdown function does not block regardless of the SO_LINGER setting on the socket.
|
|
|
|
|
hi,
iam using the shut down there but it doesnt help. i want to send a successful packet before closing the socket . it was sent but after this point was the problem . if it was single thread it works properly .but when parrelel threads are there . it still makes problems.
vineesh
|
|
|
|
|
vinucv wrote: but when parrelel threads are there . it still makes problems
What is going on in these threads? As far as I know, sending from simultaneous threads is not
a good idea without synchronization. This may not be the case but I've never found documentation
that Windows Sockets is thread safe.
Are you destroying a thread while it's blocked on send()?
Are you closing the socket on one thread while another thread is blocked on send()?
The socket will be in blocking mode unless you've called WSAAsyncSelect or WSAEventSelect (this
could be different if you are using MFC socket classes).
|
|
|
|
|
Mark Salsbery wrote: As far as I know, sending from simultaneous threads is not
a good idea without synchronization.
Perhaps vinucv should be getting his fish filet from McDonalds
led mike
|
|
|
|
|
!!!
|
|
|
|
|
the actual purpose of the code is a remote execution of programs.
i am trying to shedule windows programs in unix machines .
the failure case is only one
*)
suppose i am scheduling four parellel programs(PG1,PG2,PG3,PG4) .after the completion of first program (e PG1)i have to fire another program (PG5)
and only after the completion of all the parellel programs (PG1--PG4) another program PG6 has to be fired.All these programs are windows programs residing in windows machines.only the sheduling is done at the unix machine.
windows machines contains some agent programs for this and they are multithreaded. they send the details to unix serverand if program exists sends an exit status .this status should be read by unix machine and update the status in schedule.
suppose pg1 finishes first it will fire the program pg5 right?\
but it will not update the stauts to finish since the socket for the particular thread was not read as closed at unix .hence it has to wait for all the threads to finish and only after the programs pg1-pg4 are finishes
pg5 and pg6 are fired .
iam synchronized the threads and tried shutdowm with WSAAsyncSelect but all doesnt help.
vineesh
|
|
|
|