|
I just checked and AfxBeginThread returns a POINTER to a CWinThread.
You might want to do this instead:
//nThread = the number of threads I need to start
CWinThread* pMyThreads[nThreads]; // <-- note array of POINTERS now
for (int i = 0; i < nThreads; i++)
{
pMyThreads[i]= AfxBeginThread(MyThreadProc, this);
}
I think that will work.
|
|
|
|
|
I need to be able to fetch bulk records on tables that contain binary columns such as images.
RFX_Binary_Bulk seems to be limited to INT_MAX and I didn't find something like RFX_LongBinary for bulk.
Any suggestions ?
Regards,
Yariv
|
|
|
|
|
I know with using ADO, you use GetChunk(). maybe you can find something equivalent for what you are doing.
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
Well, the title could be a little misleading. I have a CFormView as my main 'dialog'. I have a modeless dialog that I use for a chat window. When a user minimizes the main window, I want the chat window to still be visible. I've tried changint the style of the chat window to 'child','popup', and 'overlapped' and it still doesn't work. Likewise, I'd also like the chat window to show on the desktop without the main form if the main form is minized when new chat comes in. Right now the chat window isn't visible after receiving a message until the main window is restored. I've also tried using the hWnd of the desktop when creating the dialog, but that still doesn't help. Any suggestions are appreciated. Thanks!!
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
The only other thing I thought to try really quick was to give it a NULL parent.
Failing that, you might not be ablke to make it a 'dialog' at all, and will have to make it a full-blown window - a regular window derived from CWnd doing its own processing. Then it should be relatively independent of the main window.
|
|
|
|
|
thanks! I already tried the NULL parent thing also, and that didn't seem to work. I changed the SetForeGround property to true, and that seems to make it work for when I receive a message, but it still minimizes with the main app, so I'm thinking of seeing if it' actually a window when I minimize, and if so, show it again, the way I regularly do.
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
I think this is because MFC is traversing the window chain and 'windows' associated with the main user interface thread and just minimizing the whole lot of them when it is going down.
IF you were to place your modeless dialog into a separate user interface thread and parent it to the desktop it might not get minimized with the rest of the applications windows.
I have not tried this before, but that is the direction I would head next.
|
|
|
|
|
I fixed it in the CMainFrame class so that when my app is minimized, it makes a call to these three functions:
pView->m_pDlg->ShowWindow(SW_SHOW);
pView->m_pDlg->SetForegroundWindow();
pView->m_pDlg->SetFocus();
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
Three methods for dealing with dangling pointers are tombstones, lock-and-keys and garbage collection. What are the advantages and distadvantages of these ?
Regards,
Asim
|
|
|
|
|
Wasn't this covered in class?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
You would have to attend class to know though!
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
I don't know, but it sounds like an interesting article for you to write and post on CP if you ever find the answer!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
You should really do your own homework, but I'll help you out just this once...
Tombstones
(adv) Not limited by the system's run length encoding limits.
(dis-adv) Can only be used once in an application.
Lock & keys
(adv) Easy to implement.
(dis-adv) Cannot be used in Unicode mode or when an app needs to divide by zero (eg: during complex mathematical computations).
Garbage collection
(adv) Can be used for procedures as well as functions.
(dis-adv) Not supported in languages like Java or C#.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
OK, you are right.
Thank you very much anyway, Ravi.
Regards,
Asim
|
|
|
|
|
Garbage collection
(dis-adv) Not supported in languages like Java or C#.
Are you sure with this?
|
|
|
|
|
I coded like this:
#pragma data_seg("Shared")
HWND g_hWndCaller = NULL;
HHOOK g_hHook = NULL;
#pragma data_seg()
#pragma comment(linker, "/SECTION:Shared, RWS")
but it does not work, why?
|
|
|
|
|
Do MSDN articles Q100634 or Q125677 help?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Just in case it is sotehing as STUPID as this..
I notice the documentation shows /INCLUDE, but the sample shows this:
#pragma comment(linker, "include:__mySymbol")
So, as a suggestion, why don't you try using all lowercase for the word 'section':
#pragma comment(linker, "/section:Shared, RWS")
Also, you might want to call your section something besides 'Shared' so you don't confuse the compiler or linker over another keyword. Use your company initialz in front of it or something..
#pragma data_seg("YCIShared")
HWND g_hWndCaller = NULL;
HHOOK g_hHook = NULL;
#pragma data_seg()
#pragma comment(linker, "/section:YCIShared, RWS")
|
|
|
|
|
Hi,
I am working on vc++ project and i have store the details of that application in registry, is it possible to rename a registry key(hive) through coding.
can anyone help me through this.
Thanks and Regards,
R.Sundaram.
R.Sundaram
|
|
|
|
|
There is no single function to do this. One way would be to use RegSaveKey() and RegRestoreKey() , but those only work on Windows NT 3.1 and later. Another way is to use a series of copy and delete calls.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
All:
I have created a process using CreateProcess() with a NULL executable module and the STARTUPINFO specifies tha the window is to remain hidden (which works). The question is how do I send this 'new' process a message to show the console window which was hidden during startup?
STARTUPINFO Task_SI;
ZeroMemory(&Task_SI, sizeof(Task_SI));
Task_SI.wShowWindow=SW_HIDE;
Task_SI.dwFlags=STARTF_USESHOWWINDOW;
Task_SI.cb = sizeof(Task_SI);
PROCESS_INFORMATION Task_PI;
CreateProcess(
NULL,
CmdStr,
NULL,
NULL,
0,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&Task_SI,
&Task_PI
);
After this process is initialized, a loop begins which checks to see if the process has completed and dispatches messages while waiting...
GetExitCodeProcess(Task_PI.hProcess, ExitCode);
while(*ExitCode==STILL_ACTIVE){
while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Sleep(100);
GetExitCodeProcess(Task_PI.hProcess, ExitCode);
}
After the process completed the usual cleanup occurs.
CloseHandle(Task_PI.hProcess);
CloseHandle(Task_PI.hThread);
How do I send this process a message to display itself (the console window)?
Thanks In advance,
Wallacebw
|
|
|
|
|
Hi all,
I am faced with the following problem. I should call the functions of a DLL (whose source code is not available), which doesn't seem to be implemented using Activex technology, and is downloadable in a package very "Visual Basic-oriented". In fact, the zip file contains only the dll binary and a .bas module, which looks much like the VB version of a C++ header file. Here's an excerpt of the .bas module:
<br />
Attribute VB_Name = "AstronomyFuncs"<br />
<br />
Declare Sub aa_hadec Lib "astro32" (ByVal lat As Double, ByVal Alt As Double, ByVal Az As Double, ByRef ha As Double, ByRef dec As Double)<br />
<br />
Declare Sub cal_mjd Lib "astro32" (ByVal mn As Long, ByVal dy As Double, ByVal yr As Long, ByRef mjd As Double)<br />
Now comes the question: despite there's is no provision for use within a Visual C++ program (no .h, .lib, etc.), anybody know how to overcome this problem, i.e. how to call the methods from C++?
Any help will be highly valued.
Regards,
Emmanuele
|
|
|
|
|
If you know the name of the function, you can dynamically load your dll and then get the adress of the function. Take a look at LoadLibrary and GetProcAddress in the MSDN for more informations
|
|
|
|
|
Hi all,
I am faced with the following problem. I should call the functions of a DLL (whose source code is not available), which doesn't seem to be implemented using Activex technology, and is downloadable in a package very "Visual Basic-oriented". In fact, the zip file contains only the dll binary and a .bas module, which looks much like the VB version of a C++ header file. Here's an excerpt of the .bas module:
<br />
Attribute VB_Name = "AstronomyFuncs"<br />
<br />
Declare Sub aa_hadec Lib "astro32" (ByVal lat As Double, ByVal Alt As Double, ByVal Az As Double, ByRef ha As Double, ByRef dec As Double)<br />
<br />
Declare Sub cal_mjd Lib "astro32" (ByVal mn As Long, ByVal dy As Double, ByVal yr As Long, ByRef mjd As Double)<br />
Now comes the question: despite there's is no provision for use within a Visual C++ program (no .h, .lib, etc.), anybody know how to overcome this problem, i.e. how to call the methods from C++?
Any help will be highly valued.
Regards,
Emmanuele
|
|
|
|
|
Hello All,
I have a requirement wherein have 2 sql server databases(say machine1 & machine2).
I want to run a sql query on machine1 , which would copy 5 tables in a 'XYZ' database on machine2 TO 'XYZ' database on machine1.
Note : I have user/password for both the machines.
I tried this using BCP utility, but problem using BCP is, exceptions cannot be handled And if there is a network failure during the process of data transfer , the process console window window of BCP utility, remains still(stuck) and needs user input to continue.
Please send me a QUERY(I already know about the Export/Import in SQL Server Enterprise Manager, but i need a query to run from vc++) to copy tables between 2 sql servers. that query, i should be able to place between BEGIN & COMMIT Transaction Process.
Waiting for ur reply.
Regards,
Prax.
|
|
|
|
|