|
Hello Michael
Thanks for the suggestion.
I used ::SendMessage(hwnd, TB_PRESSBUTTON, (WPARAM) (int) 222, TRUE) for programatically launching individual toolbar buttons using their controlid in this case (WPARAM) (int) 222, but the button click does not happen and it does not launch the asssociated button window. it greys the corresponding buttons and i can see the effect on the toolbar.
after getting the toolbar handle and indvidual toolbar buttons control id i want to perform a click on each button and launch their resp window programatically one after the other?
Am i missing something.Waiting for a suggestion.
Thanks in advance.
Sincerely
Giftsana
|
|
|
|
|
Hi
My scenario is:
For example developing a big project.You divide project to some pieces.And start to writing components.And then coding UI and binding them with your components.
You must disturb you exe with your dll's.But how can we restrain that other coders to use our dll's in your application.
I mean for example i installed sygate firewall.In its directory there are some dll's like:
IdsTrafficPipe.dll,Netport.dll,PSSensor.dll etc...
1-)Here how can we use like these dll's methods?(We can use win32api:system32.dll, gdi32.dll...)
2-)If i develop my application and make dll files to store my methods, how can i avoid to using these dll's other's by binding runtime?
Thanks.
|
|
|
|
|
hi all,
i have to dynamically increase the Dialog and its controls when the Dialog Box is Dragged. Any Solution.
please let me know.
thanks,
uday.
uday kiran
|
|
|
|
|
Hi kiran janaswamy,
Whats question?
|
|
|
|
|
check here^
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
See the "Extras" section of this article.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
How can I start an external program - probably an .exe file - in a C++ program. And which would be the best way to be sure the external program has finished?
|
|
|
|
|
Create to process using CreateProcess or ShellExecute (there are other options). Use WaitForSingleObject on the process HANDLE to wait till process has exited.
Steve
|
|
|
|
|
Hi MrChefman,
maybe it is some helpful to you
if you run an application from your program use
PROCESS_INFORMATION l_ProcessInfo;
STARTUPINFO l_StartupInfo;
ZeroMemory(&l_StartupInfo, sizeof(STARTUPINFO));
l_StartupInfo.cb = sizeof(STARTUPINFO);
l_StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
l_StartupInfo.wShowWindow = SW_SHOWMAXIMIZED;
CreateProcess(NULL,
"Notepad.exe",
NULL,
NULL,
FALSE,
CREATE_NEW_CONSOLE,
NULL,
NULL,
&l_StartupInfo,
&l_ProcessInfo);
}
|
|
|
|
|
To complete this example:
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
PROCESS_INFORMATION l_ProcessInfo;
STARTUPINFO l_StartupInfo;
ZeroMemory(&l_StartupInfo, sizeof(STARTUPINFO));
l_StartupInfo.cb = sizeof(STARTUPINFO);
l_StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
l_StartupInfo.wShowWindow = SW_SHOWMAXIMIZED;
if ( CreateProcess(NULL,
"Notepad.exe",
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&l_StartupInfo,
&l_ProcessInfo))
{
CloseHandle(l_ProcessInfo.hThread);
WaitForSingleObject(l_ProcessInfo.hProcess, INFINITE); // Wait for it to finish.
CloseHandle(l_ProcessInfo.hProcess);
}
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Forgetting to close the handles is a common source of resource leaks.
Steve
|
|
|
|
|
|
Thanks a lot. But I still have a problem in Building the .exe file. Linking works but when trying to build the .exe there are errors:
unresolved external symbol _WinMain@16
I hope, my translation from the German version into English is right
I included both header-files windows.h and winbase.h into my win32-application-project.
Where is my mistake?
|
|
|
|
|
You must insert library Kernel32.lib to your project
-----------------
conglt
|
|
|
|
|
The linker is looking for the entry point for a console application, but the application is being compiled and linked as a windows application (i.e. not a console application).
This error has been observed after changing the project settings from using MBCS to UNICODE characters.
Under the project settings, under the ‘Link’ tab, category ‘output’, set the ‘Entry-point symbol’ to ‘wWinMainCRTStartup’.
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanks a lot. It works!
But there's still a little problem:
When I use the external thread, the command line interface appears for a short time. how can I suppress the command line?
|
|
|
|
|
MrChefman wrote: ...the command line interface appears for a short time.
You mean the console window? Have you tried using ShellExecute(..., SW_HIDE) , or setting STARTUPINFO.wShowWindow to SW_HIDE if using CreateProcess() ?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
It seems I come here with the strangest questions sometimes... but here goes.
Is there a way for my C++ app on my client to be recognized as present by my web app?
---
I install my app
I browse to my remote website
... can the web app detect that my app is installed?
... would prefer this not to be IE dependent....
Thanks for your thoughts!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Peter Weyzen wrote: Is there a way for my C++ app on my client to be recognized as present by my web app? \
if you cpp application can send query the web app?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I was kinda looking for a javascript-ish way or something like that....
but maybe communication from the client could be enough information to make the webserver know that "this machine" is where the client is installed?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Peter Weyzen wrote: but maybe communication from the client could be enough information to make the webserver know that "this machine" is where the client is installed? .
I am afraid, i fail to understand you problem
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I want to be able to browse to my website -- and have the webpage behave differently if my application is installed on this machine. I would like additional links to show up when it's installed here... or have the webpage figure out this is my home machine....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
hai to all
i have created a thread function
void ThreadRoute1( void* arg )
{
USES_CONVERSION;
HANDLE hDir = CreateFile( "C:\\", // pointer to the file name
FILE_LIST_DIRECTORY, // access (read/write) mode
FILE_SHARE_READ|FILE_SHARE_DELETE, // share mode
NULL, // security descriptor
OPEN_EXISTING, // how to create
FILE_FLAG_BACKUP_SEMANTICS, // file attributes
NULL // file with attributes to copy
);
FILE_NOTIFY_INFORMATION Buffer[1024];
DWORD BytesReturned;
while( ReadDirectoryChangesW(
hDir, // handle to directory
&Buffer, // read results buffer
sizeof(Buffer), // length of buffer
TRUE, // monitoring option
FILE_NOTIFY_CHANGE_SECURITY|
FILE_NOTIFY_CHANGE_CREATION|
FILE_NOTIFY_CHANGE_LAST_ACCESS|
FILE_NOTIFY_CHANGE_LAST_WRITE|
FILE_NOTIFY_CHANGE_SIZE|
FILE_NOTIFY_CHANGE_ATTRIBUTES|
FILE_NOTIFY_CHANGE_DIR_NAME|
FILE_NOTIFY_CHANGE_FILE_NAME, // filter conditions
&BytesReturned, // bytes returned
NULL, // overlapped buffer
NULL// completion routine
))
{
CTime tm = CTime::GetCurrentTime();
CString helper_txt;
switch(Buffer[0].Action)
{
case FILE_ACTION_ADDED: break;
case FILE_ACTION_REMOVED:break;
case FILE_ACTION_MODIFIED: break;
case FILE_ACTION_RENAMED_OLD_NAME: break;
case FILE_ACTION_RENAMED_NEW_NAME: break;
}
int i=0;
do
{
m_Sec.Lock();
int item = pList1->InsertItem(pList1->GetItemCount(), CString(Buffer[i].FileName).Left(Buffer[i].FileNameLength / 2) );
pList1->SetItemText(item, 1, tm.Format("%Y/%m/%d/ - %H:%M:%S"));
i++;
m_Sec.Unlock();
}
while (!Buffer[i].NextEntryOffset);
}
}
i have called the thread by using a button click function.when i click the button the followinf function works
_beginthread( ThreadRoute1, 0,0 );
here i have a problem .the problem i need to pass a directory path which i have written in a edit box .how can i pass that path to the thread function which i created
please help me to solve this problem
|
|
|
|
|
hi
u can pass a void pointer parameter to thread by _beginthread() function.
_beginthread() syntex:
_beginthread(threadname, stack_size, void *parameter);
in ur case,
_beginthread(ThreadRoute1, 0, (void *)filepath);
In thread():
void ThreadRoute1( void* arg )
{
char *filepath;
filepath=arg;
.........
........
}
By
Parthiban
|
|
|
|
|
hai parthiban
thanks for ur reply.
but a small problem is there
an error is coming when i do this.
can u rectify it.
error C2440: '=' : cannot convert from 'void *' to 'char *'
|
|
|
|