|
Yep, of course it needs lock protecting.
|
|
|
|
|
True. If you asked me how to implement a singleton in a multi-threaded environment, I might have thought of that
Oh well, maybe I'm just lucky that the things I work on involve virtually no multithreading at all!
|
|
|
|
|
This is an academic question - can standard MFC CSplitterWnd class be easily modified to allow floating static views?
There are few posts here about splitter window which do wonderful things, but not necessary easy to adopt.
Ideally I would like to have ability to select a view in sort-off pop-up fashion - make a duplicate and be able to move it around / re-size etc.
Any opinions are welcome.
Thanks for you time.
Vaclav
|
|
|
|
|
You can change the size of a splitter window by dragging the splitter bar and/or resizing its parent window. If you want a floating window then that is a different thing altogether. Perhaps you could explain some more of what you are trying to do.
|
|
|
|
|
I have an application ( ham radio logging program ) which have / needs several views of the database document - mostly different files and some statistics.
The main interaction with user is simple data entry, one view in real time, and than updating the views.
I need to keep minimal mouse / keyboard interaction to manipulate the auxiliary views.
Using splitter is OK, but I would like to be able to “pop-up” the main view and keep the splitter running in the background.
My goal is – minimal mouse interaction ( the user is using both hands to “work “ the hardware already ) – say using function keys to do this, maybe even voice interface.
|
|
|
|
|
You have a number of options:
- use an MDI window so you can control which child window is at the front
- have a full-frame child window that you show or hide on demand
- have a separate frame window independent of your main one
There are probably other possibilities that you could consider; it all depends on how you want to interact with your users.
|
|
|
|
|
Hi, all!
I'm addicted to VC++ since 2008, and I begin to work for my current company from 2011 when I graduated in Mathematics. Now I still love VC++, it is a wonderful programming language.
Now I'm a little confused whether it's a good idea to continue with Windows Programming.
Now I'm in Beijing, China. Of course, I come from China. I want to find a work in Silicon Valley, America in the future.
Can anyone tell me is it possible for me to find a VC++ work in Silicon Valley someday in the future? And what should I do in the recent years?
Any help would be greatly appreciated!
modified 5-Jul-12 20:51pm.
|
|
|
|
|
Falconapollo wrote: is it possible for me to find a VC++ work in Silicon Valley someday in the future?
Who knows? The world might end, the companies may move north or east, some new technology may make them all redundant ...
Falconapollo wrote: And what should I do in the recent years?
Again, how can anyone say without being able to predict the future.
A much better idea would be to look around your local area at the companies that are hiring and see if you have, or could learn the skills that are in demand. The more different languages and frameworks you can work with the more chance there is of getting a better job in the future.
|
|
|
|
|
Thank you.
Your answer is short but useful.
|
|
|
|
|
Falconapollo wrote: Now I still love VC++, it is a wonderful programming language.
That is a bit general.
C++ is a programming language. And the MS implementation is a fairly decent (these days) implementation of that.
Managed C++ is also a programming language. It derives from C++. It might be a strict super set, but one would need to looks at the specification to determine that.
The windows API, are libraries which one uses with a programming language.
Falconapollo wrote: And what should I do in the recent years?
Learn SQL, probably TSQL (Microsoft SQL Server). SQL programming is significantly different that programming in C++ (or C, Java, C#, for that matter). So it gives more breadth to your knowledge. Plus relational databases are not going to go away.
|
|
|
|
|
Thank you for you recommendations.
|
|
|
|
|
Falconapollo wrote: Can anyone tell me is it possible for me to find a VC++ work in Silicon Valley someday in the future?
Sure, why not? ...but, if you want to find work in America, diversify yourself as a professional. In another words, no one wants to hire someone that's only good at one thing, learn different things, that's what most small companies want (which make up a large number of employers). Silicon Valley is full of innovative companies but competition for jobs is tough, so make sure you stand out in the crowd.
|
|
|
|
|
Thank you for your reply.
I think I know what to do during the recent years from your recommendations.
|
|
|
|
|
Sure, good luck!
|
|
|
|
|
Hi,
I have a Edit Box. How can I restrict this Edit Box
so that it will accept characters like '=' and ';'
This is not MFC based. Win32 only.
Thanks in advance.
|
|
|
|
|
Handle the WM_CHAR message.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
|
Does anybody remember a graphics library shipped with older MS C compilers? Is there available something similar to that one, maybe in (open) source version?
|
|
|
|
|
Use Windows' own GDI[^] or GDI+[^] for graphics programming, it is so much simpler than any of the older libraries.
|
|
|
|
|
are you using an old DOS C compiler (MSC 5 or MSC 6, etc.) ?
if so, that's going to be tough...
|
|
|
|
|
Found [here]
Scroll down to [svgacc25.zip]
svgacc25.zip Size: 183,989 Date: 03-31-97
SVGA Gfx lib for MS compatible C/C++ compilers
|
|
|
|
|
Hi!
I'm calling an exe from a Batch file using CALL statement. The exe is not the same folder with batch file. The exe is inside some other folder.
The exe has some dependencies(VC++ DLL's). How to include/call those DLL's also inside the CALL statement so that my exe would run without errors?
The code that I use is:
<pre>
PushD .
Cd ..
Call Gen /AssetManager:Disable /DisplayErrors:off /ReturnErrorsCount:off /Log:Enable /Log:Html /Log:Verbose /Window:Normal /CreateObjectHash /RemoveSources:On /CreateResourceHash /GenerateDisplayLists:On /GenerateSceneLists:Off /GeneratePreDrawOT "france_1222\Test.xml" france_1222\%_SDF_% "iPhone"
PopD
</pre>
"Gen" is my exe name.
|
|
|
|
|
You don't need the CALL command to execute an executable program from within a batch file. The CALL command is provided to execute other batch files from within a batch file or call a local subfunction.
Each executable file tries itself to resolve DLL dependicies. If your application terminates due to missing DLLs, you must place the DLLs in common directories or modify the DLL search pathes.
Common DLL directories are:
- The directory from which the application loaded.
- The system directory.
- The Windows directory.
- The directories that are listed in the
PATH environment variable.
To add directories that are searched by your application you may use the API function SetDllDirectory() .
To add directories using a batch file, append them to the PATH environment variable.
|
|
|
|
|
hi i need to know to evaluate acpi methods that need input arguments. I need to use to ACPI_EVAL_INPUT_BUFFER_COMPLEX_EX for input buffer type and im not sure how to specify the arguments. I tried few things but the IoCallDriver returns Record length error. Pls help me with an example.
|
|
|
|
|
Hi,
I am trying to start 4 socket connections (same IP different socket) with each running in thier own threads
here is the class defination for the Derived CWinThread
class SockCLeintThread : public CWinThread {
public:
public:
SockCLeintThread(UINT myport);
~SockCLeintThread();
CWnd *sendwindow;
CWnd *call_wnd;
char *thread_id;
SockClient thisocket; virtual BOOL InitInstance(); void Sendit(WPARAM, LPARAM);
void Receiveit(WPARAM, LPARAM);
LPCTSTR ipaddr;
BOOL idle; allexceptions myallexception;
struct {
unsigned int is_connected : 1;
unsigned int busy : 1;
} flags;
protected:
DECLARE_MESSAGE_MAP()
};
Class defination for the derived CAsynSocket Class
class SockClient : public CAsyncSocket
{
public:
SockClient(UINT myport);
char *sockbuffer; int num_buff;
CWnd *send_wnd;
int thread_no;
UINT port;
private:
int busy; protected:
virtual void OnReceive(int nErrorCode);
virtual void OnSend(int nErrorCode);
virtual void OnConnect(int nErrorCode);
virtual void OnClose(int nErrorCode);
the custructor for the CwinThread takes a port #
I start these threads in My CwinApp::Initinstance
here is the loop
for (i = 0, start_port = 11007; i < 4; start_port++, i++)
{
threadptr[i] = new SockCLeintThread(start_port);
if (threadptr[i] == NULL)
m_pMainWnd->MessageBox("SockClientThreadFail",NULL,MB_ICONERROR);
threadptr[i]->CreateThread(CREATE_SUSPENDED,0,NULL);
threadptr[i]->flags.is_connected = 0;
threadptr[i]->ipaddr = "192.168.1.4";
SetThreadName(threadptr[i]->m_nThreadID,thread[i]);
threadptr[i]->ResumeThread();
}
Here is the constrocter of the dervived CwinThread
SockCLeintThread::SockCLeintThread(UINT myport) : thisocket(myport)
{
m_bAutoDelete = FALSE;
}
The Constructer for the derived CAsynSocket
SockClient::SockClient(UINT myport)
{
port = myport;
sockbuffer = new char[300];
}
in the CwinThread::initinstance is were is I create the socket and try to connect
OOL SockCLeintThread::InitInstance()
{
int error_code;
MSG m_msgCur;
extern void SetThreadName( DWORD dwThreadID, LPCSTR szThreadName);
if(thisocket.Create(thisocket.port,SOCK_STREAM,NULL)== 0)
{
error_code = GetLastError();
}
if (thisocket.AsyncSelect (FD_CONNECT|FD_CLOSE|FD_OOB|FD_ACCEPT) == 0)
error_code = GetLastError();
if( thisocket.Connect(ipaddr,thisocket.port) == 0)
{
error_code = GetLastError();
}
else
flags.is_connected = 1;
PeekMessage(&m_msgCur, NULL, NULL, NULL, PM_NOREMOVE);
return TRUE; }
I have step thru this code numerous times an have gotten exception st different points but mostly at the CAsynSocket::Create
If I am not going about this right way please let me know
|
|
|
|