|
Thank you!
I appreciate the response. I actually had figured it out after some battling. I am not too familiar with the user interface, so I didn't know this option existed. But you are absolutely correct.
Thanks again for helping me out, I always appreciate it very much.
NickOne
|
|
|
|
|
can i dock CDialogBar as CToolBar to anywhere and resize it as needed?
if yes, what is key to do?
thanks
includeh10
|
|
|
|
|
|
before i study for hrs, hope u give me one more word: can i do it (should be yes, i guess)?
a duke dollar and a for u.
includeh10
|
|
|
|
|
before i study for hrs, hope u give me one more word: can i do it (should be yes, i guess)?
Should be yess. The code needed is nevertheless so little that you'll be better off pasting it into your app and seeing the results.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i tested both c++ and java socket (under windows), got similar results:
i.e. max 45 sockets in a single machine (clients and server are in the same PC).
i think there is no different between c++ and java socket from efficent, speed or capibility view.
do u have different thinking or experieces?
includeh10
|
|
|
|
|
You are basically right, Java and C++ sockets are mapped to system sockets, so they behave pretty much the same.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Suppose, you have a wizard that has bitmap on top of every page. Then, you want to add a title to the bitmap of every page. You don't want to modify the bitmap itself, rather add a text using something like CStatic. How would you do it?
I have tried adding a transparent CStatic and it doesn't work. I have played with other options on CStatic and they don't seem to work either. Any ideas?
thanks
|
|
|
|
|
Transparent CStatic s aren't really that static. You can use (for instance) Norm Almond's CLabel to have true transparency.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have a window that contains an ActiveMovie4 control. I set the control window to be 500 x 500 originally, then the video resizes itself to suit the file opened. How can I get this new rect?
|
|
|
|
|
With GetWindowRect ?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
yeah, with GetWindowRect. It doesn't get the correct rect.
|
|
|
|
|
Is there a way to put a thread to sleep and wake it up from outside of the thread itself? I have a thread that gets created regardless of what mode I'm in but would like for it to just go to sleep when in one mode and wakeup and goto work in another. When the user makes a menu selection for mode, I want to respond accordingly.
I know there is the sleep command but that is for inside of the thread. I also know about WaitForMultipleObjects and some about events. Since this is already written code, and is already waiting for certain events, i.e. application shutdown, read from serial port, etc., I don't want to have to add new events and code. In one mode (the non-serial mode), I don't want it to wait for these events, I want it to sleep or wait INFINITE until application shutdown. In the other mode, I want it to respond to serial events and application shutdown. I know I can make it work if I recode this section but is there an easier way?
|
|
|
|
|
Nevermind. I found it. SuspendThread(). I don't know why it isn't listed in the "See Also" section of Sleep() but it isn't. Oh well...
|
|
|
|
|
Aehm, sounds not that difficult...
Just use
SuspendThread( HANDLE hThread )
to send the thread to sleeping state, and
ResumeThread( HANDLE hThread )
to awake it.
BTW: SuspendThread()/ResumeThread() maintain an internal counter, which means you could call SuspendThread() for n times, but then have to call ResumeThread() also for n times before the thread reaches READY state again.
--
Daniel Lohmann
http://www.losoft.de
|
|
|
|
|
can any one tell me how to open the msword documents programmatically?
I used an article HOWTO: Use WordBasic Functions in an MFC Automation Client for Word 97, Word 2000, or Word 2002 (Q252719)
as an reference.
the problem is giving me at
<br />
COleVariant vOpt(DISP_E_PARAMNOTFOUND, VT_ERROR);
<br />
_Document document = documents.Open(COleVariant("e:\\APQAD.DOC"), vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt);
why i can't open it????
|
|
|
|
|
if creating a CToolBar, there is always a vertical line for each separate button, i think the line is too ugly but i try several hrs (change style or ex style) and still can remove it.
could u give me a hand?
thx
includeh10
|
|
|
|
|
Do you mean the separators, or the actual buttons themselves.
If you're using flat toolbars, separators look like etched vertical lines.
If you're not using flat toolbars, buttons look like... buttons, with two vertical lines and two horizontal ones.
If you're seeing a single vertical line, right down the center of the screen, you've got one of those annoying Trinitron monitors turned on its side...
--------
PMGRE --Shog9 --
|
|
|
|
|
yes, i mean separators and flat tool bar by CreateEx function, but i don't understand ur idea for deleting the vertical line (the separator button is still there and just no the vetical line)
more info please, thx
includeh10
|
|
|
|
|
So, what you want to do, is have a flat toolbar, with separators, but not showing the separators?
You can use the technique described in this article [^] to do so.
--------
PMGRE --Shog9 --
|
|
|
|
|
I am trying to learn how to create and use dll, but so far I haven't been able to even print a "hello" message on the screen. I am reading instructions at msdn library, but can't find what I need. I need instructions(basic) on how to create and load dll. Any simplest examples(say to print "hello" using dll)anyone could send me I would appreciate.
Is there any book about dll, or any website?
A project I created gives me 2 errors("could not get function 1 process address")when is executed; it is compiled without errors.
Here is my .def file:"
LIBRARY prcAttach
DESCRIPTION "Where the functions really live"
EXPORTS
function1 @1
function2 @2 "
I set "Not Using MFC" in Project/settings/general because that's what a friend of mine uses and his project works fine.
Here is my dllLoad.cpp file
#include <windows.h>
#include <iostream>
//typedef for a: int function1(int i);
typedef int (*F1)(int);
//typedef for a: char function2(char c);
typedef char (*F2)(char);
int main(int argc, char * argv[])
{
HMODULE hDll;
F1 func1;
F2 func2;
hDll=LoadLibrary("prcAttach.dll");
if(hDll==NULL)
std::cout << "Could not load dll" << std::endl;
else
{
MessageBox(NULL,"Library loaded","dllLoad",MB_OK);
func1=(F1)GetProcAddress(hDll,"function1");
if(func1==NULL)
std::cout << "Could not get function 1 proc address" << std::endl;
func2=(F2)GetProcAddress(hDll,"function2");
if(func2==NULL)
std::cout << "Could not get function 2 proc address" << std::endl;
MessageBox(NULL,"functions found","dllLoad",MB_OK);
MessageBox(NULL,"Hello","dllLoad",MB_OK);
func1(1);
func2('a');
FreeLibrary(hDll);
}
return 0;
}
Here is my prcAttach.cpp file(prc-short for process)
#include <windows.h>
void ShowMessage(char const * szcM)
{
MessageBoxEx(NULL,szcM,"HostDLL",MB_OK,LANG_ENGLISH);
}
extern "C"
{
int function1(int i) {ShowMessage("I changed hostdll function 1");return i;}
char function2(char c) {ShowMessage("hostdll function 2");return c;}
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID
lpvReserved)
{
switch(fdwReason)
{
case DLL_PROCESS_ATTACH:
// Initialize once for each new process.
// Return FALSE to fail DLL load.
DisableThreadLibraryCalls(hinstDLL); // Remove to allow multiple threads to attach
break;
/* uncomment this block to handle multiple thread attachments
case DLL_THREAD_ATTACH:
//Do thread-specific initialization
break;
case DLL_THREAD_DETACH
//Do thread-specific cleanup
break;
*/
case DLL_PROCESS_DETACH:
// Perform any necessary cleanup.
break;
}
return TRUE; // Successful DLL_PROCESS_ATTACH.
}
Could anyone help please!
thanks in advance
mel
|
|
|
|
|
The code looks fine to me. Have you by chance forgotten to insert the .DEF among the files in the DLL project (as you would with an ordinary .cpp file)?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I tried:
void CFormViewMDIView::OnChecking()
{
//GetDlgItem(ID_CHECKING)->SetWindowText("abc");
m_toggle = m_toggle==0? 1 ;
// if (m_toggle == 0)AfxMessageBox ("aaaa");
}
void CFormViewMDIView::OnUpdateChecking(CCmdUI* pCmdUI)
{
pCmdUI->SetText(m_toggle? "Search":"Start") ;
}
But the text doesnt change. What am I not doing right?
Thanks,
ns
|
|
|
|
|
|
I didnt mean to ask the same thing twice. Thanks for the reply. I posted my questions regarding that in response...
|
|
|
|