|
|
|
|
Do you get any error or have problem on your program?
|
|
|
|
|
Hello,
Thanks for your concern.
You have also replied to my other mails where my problem is about creating dialogs without resource-ID.
You directed me to a link where a program example was given about the same.
It was helpful but still I am stuck in my program.
This is my code.
D dlg;
DLGTEMPLATE *d = new DLGTEMPLATE;
d->x = 10;//(short)m_Rect.left;
d->y = 10;//(short)m_Rect.top;
d->cx = 200;//(short)m_Rect.Width();
d->cy = 200;//(short)m_Rect.Height();
d->style = WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_SETFONT;
d->cdit = 0;
int iRet = dlg.InitModalIndirect(d);
dlg.DoModal();
Here in the above code I get iRet = 1 but the dialog box is not displayed even when I give dlg.DoModal()
Thanks
Prithaa
|
|
|
|
|
Im sorry I dont have any compiler know but I think if returns 1 so it can makes your dialog.
|
|
|
|
|
Dear all
how to understand parameters below. give me suggestion.thanks a lot.
CFileDialog dlg(FALSE,_T("BMP"),_T("*.BMP"),OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,_T("Save bitmap pattern(*.BMP)|*.BMP|"));
Li Zhiyuan
29/06/2007
|
|
|
|
|
CFileDialog( BOOL bOpenFileDialog, LPCTSTR lpszDefExt = NULL, LPCTSTR lpszFileName = NULL, DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, LPCTSTR lpszFilter = NULL, CWnd* pParentWnd = NULL );
Parameters
bOpenFileDialog
Set to TRUE to construct a File Open dialog box or FALSE to construct a File Save As dialog box.
lpszDefExt
The default filename extension. If the user does not include an extension in the Filename edit box, the extension specified by lpszDefExt is automatically appended to the filename. If this parameter is NULL, no file extension is appended.
lpszFileName
The initial filename that appears in the filename edit box. If NULL, no filename initially appears.
dwFlags
A combination of one or more flags that allow you to customize the dialog box. For a description of these flags, see theOPENFILENAME structure in the Win32 SDK documentation. If you modify the m_ofn.Flags structure member, use a bitwise-OR operator in your changes to keep the default behavior intact.
lpszFilter
A series of string pairs that specify filters you can apply to the file. If you specify file filters, only selected files will appear in the Files list box. See the Remarks section for more information on how to work with file filters.
pParentWnd
A pointer to the file dialog-box object’s parent or owner window.
hope this willget all clear
|
|
|
|
|
true mean file open dialog n false mean file save as dialog
|
|
|
|
|
hi guys,
i have a dialog application, i want to launch 10 worker thread and each worker thread will do a particular work, ie. each worker thread will connect to a url and download the page content, and they will parse the page and write some data to a database, so imagine if there are 1000 pages then if i go by general way of geting pages one by one it will take me around 20 mins to 45 mins, so i was thinking if launch 10 thread which in term each will collect 1 page then the time may be reduced,
my problem or query is,
as fas of today is, we all using single processor, so no matter how many threads u create, any given point of time only one instruction will carried out, but when i launch more then one application of mine and break up the collection say app1 collects 100 and app2 collects another 100, this is faster then collecting 1000 in 1 application, so breakin it to threads will help or not,
how to code for it, do you have any idea i mean any design for it, or any help for it,
cas i cant write 10 diff function for each thread,i want one function to do all the work but i will pass diff parameter for each thread, but then comes the problem resource access violation if i call the same function for each thread,
so is there a way i can the thread callback to a class, or i can put the whole code, for say
class mythrdcls
{
mythrdcls(char *)
{}
void create(){}
void dothetask(){}// like a thread callback function
void running(){}
void destroy(){}
}
so please give me an idea how to do it,
ya one more thing i forgot to add here, when i call createthread or afxbeginthread, i have to call a thread callback, i want to pass some arguments to my thread callback funcion, so i can pass them in param value, i want to pass more then one value so i have to create a structure and pass it, but the problem is in thread function it does not reflect the correct value,
ie struct th
{ int x;int y} x;
x.y=10,x.x=1
beginthread(function1, x);
x.y=20,x.x=2
beginthread(function2, x);
function1()
a=x;
a.x///////////does not alwys contain 1 ie cas by the time callback is called the value is changed to 2 so how can make sure tht unless the thread callback is called the 2nd thread cant be created or ast thread get the corect value and so 2nd thread also, i used waitforsingleobject but it did not help
Thanks a lot
|
|
|
|
|
thanks anyway,for no reply, figured it out myself, any one need help in tht case let me knw
|
|
|
|
|
Hi All,
I have an application that tries to print a PDF File to a network printer from the WebBrowser control. I am able to print the report if I just run the exe directly. But when I tried to start the application from a service as a new process then it could not find the network printers. Is there any secruity permissions to be applied when starting a new process from the service? Or what could be of the cause and its possible solutions?
Kindly help me.. I am just struggling a lot in this!!
Thanks,
Sivakumar R
|
|
|
|
|
Your service runs under the local account, which means that it won't be able to use network resources.
Start the service under a given user account instead. And use a user account that has the rights to do network printing.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Hi,
You are right. The service is currently running as a local system account. But I have one more limitation here. My application is a Desktop Application, I am starting this through a Service to grant/deny some rights to my application. So the service needs to be on a Local System Account to enable this option.
I tried configure the service to work with the network user. But unfortunatly, my application is not displaying the GUI. I gone through the following article : http://www.codeproject.com/install/...vicedesktop.asp
to try to enable the service to interact with the service. But it does not seems to be working.
Here is what I was trying to do..
- I tried to login as a network user
- I change the Logon properties of the service to work with a specified account.
Is it possible to make the service to interact with the desktop even if we set it not as a local system account?
Thanks a lot for your suggestions!!
Regards,
Sivakumar R
|
|
|
|
|
Sivakumar R wrote: Is it possible to make the service to interact with the desktop even if we set it not as a local system account?
Hello.
I had exactly the same problem a while ago but I couldn't find a solution, so gave up
In the end, I autostarted the app instead of running it as a service.
And configured auto-login for the user.
Not the best solution, but it worked (kind of)...
Anyway, the program is started when windows i started, which was the main demand.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Hi,
Thanks for the reply.
I had to make my application to toggle between the OS and Application. When the user login as an administrator in my app and shutdown, it should restart into the OS. When they restart from the OS, then it should go to the applicaiton mode. So I had to go for the service to decide whether to start the application of just go to the OS. Everything works well and running except that I could not access the network printer. It works well with the local printer.
I am just trying to get if we set any security attributes before starting the service / my process, is there anyway I can access the network printer.
I sincerely thanks for your valuable suggestions!!
Regards,
Sivakumar R
|
|
|
|
|
I am trying to simulate a user clicking through a series of tasks in IE. Some of those tasks require a user to click on dialog boxes, for example “Deleting this item may have harmful consequences”, or clicking through a “Save As” sequence of dialogs. I can successfully click on the buttons using windows messaging BM_CLICK. The only problem is I have to wait for 1 to 2 seconds after the dialog box is instantiated for the click to happen reliably. But just waiting for a couple of seconds is not an option in this situation. I have tried a number of things to try to deterministically figure out when it is a proper time to be able to click, like setting the dialog to the foreground, set it as the active window, I have trying using BM_LEFTDOWN, and BM_LEFTUP instead of click, trying to send a null message with a callback to make sure it is in a state to process messages, all to no avail.
I think that there is some process that must be happening in the first second or two, that I am unaware of. I would like to be able to hook into the button and listen to all the messages it is receiving or sending from the very instant that it is instantiated and maybe wait for a certain set of messages to happen before I continue the simulation.
Is there a relatively easy way of hooking into another windows messaging queue and seeing ALL the messages that it is sending or receiving (similar to spy).
-KKinnett
|
|
|
|
|
|
If you want to wait until the application is ready to accept input check out the WaitForInputIdle[^] function.
Steve
|
|
|
|
|
I am having an error
e:\Assign1\Form1.h(595): error C3861: 'strip': identifier not found, even with argument-dependent lookup
I am tryin to use the strip() function. Anyone can help?
sherryann ... i am learning
|
|
|
|
|
What strip() function? I can't find one documented
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Mark Salsbery wrote: What strip() function? I can't find one documented
That is a NSFW function.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
1 - try to put something meaningful in the subject line, so people who can help are attracted to it
2 - if you have an error, posting the error is great, but posting the code as well, is even better.
3 - Your form is called Form1, are you using C++/CLI ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How do I specify compiler options in the DDK build environments?
I trying to build with /EHsc to enable c++ exceptions...
Thanks for any help.
|
|
|
|
|