|
Hi..
I have created one dialog box and now i want to initialize text on my dialog box..
How can i initilaze my data on dialog box ?
MY code is..
BOOL Exchanger::OnInitDialog(void)
{
// m_ExchListbox.AddString(_T("Hello"));
static char m_myarray [] =
{
"Exchanger-Double end\n"
"Exchanger-single end\n"
"Exchanger-Double end kettle\n"
"Exchanger-Single end kettle\n"
"Exchanger-Super\n"
"Exchanger-Process Flow\n"
};
CDialog::OnInitDialog();
return 0;
}
Thanking you..
Shah
|
|
|
|
|
use SetWindowText() on each control you like ...
|
|
|
|
|
Thank you for your reply..
My code is like...
CDialog::OnInitDialog();
m_ExchListbox.AddString(_T("Exchanger-Double end"));
m_ExchListbox.AddString(_T("Exchanger-Single end"));
m_ExchListbox.AddString(_T("Exchanger-Double end kettle"));
m_ExchListbox.AddString(_T("Exchanger-Single end kettle"));
m_ExchListbox.AddString(_T("Exchanger-Super"));
m_ExchListbox.AddString(_T("Exchanger-Process Flow"));
Is it possible to declare it in array ??
i.e something like this..
static char m_myarray [] =
{
"Exchanger-Double end\r\n"
"Exchanger-single end"
"Exchanger-Double end kettle\n"
"Exchanger-Single end kettle\n"
"Exchanger-Super\n"
"Exchanger-Process Flow\n"
};
and then i can call through
m_ExchListbox.AddString(m_myarray); ( but here addstring ( it will take only Cstring not char.. i tires with char then its showing me error)
Is it possible to declare through array ??
Thanks a lot..
Shah
|
|
|
|
|
You can set your text of property window of dialog
|
|
|
|
|
Hi..Thanks for your help..
If possible then can u give me favor of my above question??
Shah
|
|
|
|
|
Shah Satish wrote:
CDialog::OnInitDialog();
do you what ever you want but do it after CDialog::OnInitDialog()
"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
Support CRY- Child Relief and you
|
|
|
|
|
Hi..Thanks for your help..
If possible then can u give me favor of my above question??
Shah
|
|
|
|
|
Hi,
I need to pass a relativly complicated struct into a dll calling a CORBA Service which has to be written in vc6.0 and it has to contain many elements which are necessary to create an input for a service.
Unfortunately I can see only the first array element, other are ignored.
Here an example of c# code:
<br />
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]<br />
public struct MyStrStruct3<br />
{<br />
public string FirstName;<br />
public string FamilyName;<br />
public int size;<br />
}<br />
<br />
[DllImport(@"C:\Projects\CorbaLib60\Debug\CorbaLib.dll")]<br />
private static extern int TestMe(ref MyStrStruct3[] pstr);<br />
<br />
MyStrStruct3[] Names = new MyStrStruct3[2];<br />
Names[0].FamilyName = "Konieczny";<br />
Names[0].FirstName = "Marek";<br />
Names[0].size = 3;<br />
Names[1].FamilyName = "OtherName";<br />
Names[1].FirstName = "OtherFirst";<br />
Names[1].size = 2;<br />
int miki1 = TestMe(ref Names);<br />
C++ code look like this:
<br />
typedef struct _MyStruct2<br />
{<br />
char* FirstName;<br />
char* FamilyName;<br />
UINT size; <br />
} MyStruct2;<br />
<br />
<br />
int TestMe(MyStruct2* pStruct[])<br />
{ <br />
int Size = 2;<br />
<br />
for (int i=0; i<Size; i++ )<br />
{<br />
int woofie = pStruct[i]->size;<br />
char* miki = pStruct[i]->FamilyName;<br />
char* miki1 = pStruct[i]->FirstName;<br />
}<br />
return 42;<br />
}<br />
I define export :
<br />
<br />
__declspec(dllexport) int TestMe(MyStruct2* pStruct[2]);<br />
<br />
It works, but only for first element.
Marek
|
|
|
|
|
I am surprised it worked at all!
The structure has pointers to memory and unless you are sticking the memory for the strings onto the end of the memory for the structure, I am not seeing how the memory for the strings are getting into the DLL.
This seems like more of a C# problem than a problem with the DLL you are calling - might be better to post this to the C#-related message board.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
You should look up the MarshalAs attribute, especially with the UnmanagedType.LPTStr and UnmanagedType.LPArray parameters.
And I have to agree that this question would fit better into the C# forum.
Regards,
Tim
|
|
|
|
|
Hello everyone
i need to have an activex that behaves as a modal dialog
so i need to create it dynamically and show it as modal dialog
anyone can help me with this?
|
|
|
|
|
Whenever I run some fullscreen games (not all, curiously), the Network Status and Task Manager's CPU usage icons (sitting in the systray) redraw themselves on top of the game's display every couple of seconds, creating some annoying flicker. I've noticed that this problem happens with *some* video drivers...one version will have that problem, another version won't...I usually try to keep up to date with my drivers, and the problem comes and goes. You'd think if the problem got fixed in version X, then it would remain fixed in version X+1. It seems like a crapshoot.
My solution is to uncheck the "Keep the taskbar on top of other windows" option before launching a game (and then re-check it when I exit), but having to do this every time is annoying, to say the least.
I thought I could write some little utility to toggle that option, so I could write a batch file to call it, run the game, and afterwards call the utility again to reset the setting.
My question is, how do I programmatically change that setting?
I suppose changing the taskbar's "autohide" setting would also work, so if anyone knows how to do either...?
|
|
|
|
|
See this[^] article. This should help you.
|
|
|
|
|
Interesting.
However, that's not quite what I'm after. I want to programmatically change the "Keep the taskbar on top of other windows" option, not merely display the dialog box that presents this option. I mean, ultimately, when you check/clear that checkbox, some API eventually gets called or some registry setting gets changed. This API/registry entry is what I'm after, so I can change the setting without showing some UI or involving the user.
As far as I can see, this just programmatically displays various dialog boxes.
|
|
|
|
|
Daniel Desormeaux wrote: want to programmatically change the "Keep the taskbar on top of other windows" option, not merely display the dialog box that presents this option.
Just wait a moment I can bang in something for you. I remember doing this.
|
|
|
|
|
Daniel Desormeaux wrote: However, that's not quite what I'm after. I want to programmatically change the "Keep the taskbar on top of other windows" option, not merely display the dialog box that presents this option.
Hurray Dan, Gotcha,
Msg 0x02b1 WPARAM 0x7 Taskbar always on top
Msg 0x02b1 WPARAM 0x8 Taskbar normal.
For Eg:
<br />
::SendMessage(hShellWnd, 0x2b1, 7, 0);<br />
::SendMessage(hShellWnd, 0x581, 1, 0);<br />
::SendMessage(hShellWnd, 0x550, 0, 10001);<br />
<br />
<br />
::SendMessage(hShellWnd, 0x2b1, 8, 0);<br />
::SendMessage(hShellWnd, 0x581, 1, 0);<br />
::SendMessage(hShellWnd, 0x550, 0, 10001);<br />
::SendMessage(hShellWnd, 0x579, 0, 0);
You will have to check this code. It worked for me sometime back. Hence not sure.
I got this from spy++ sometime back.
|
|
|
|
|
Cool. I'm gonna have to try this out. Thanks.
|
|
|
|
|
Daniel Desormeaux wrote: Cool. I'm gonna have to try this out. Thanks.
Set it back to it's original state once the application exits. Users hate to see their setting changed.
|
|
|
|
|
Of course. That was part of my original requirement; I certainly don't want to make the change permanent, or else I would just do it once and forget about the whole idea of writing a program... Re-read my original post.
|
|
|
|
|
Please help me,I have 2 problems.
-The first:I want to appear icon on the system tray when run my program.How do I have to do ?
-The second:When user insert a CD into CD driver.My program will be automatically communicate that event to user and show everything(files and folder)in the rootDirectory of CD in a Dialog.
-Please show me about them.
Thank you very much
|
|
|
|
|
1: Search the articles here for Shell_NotifyIcon .
2: Look up the WM_DEVICECHANGE message and any KB articles associated with it.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
|
Hi,
I created a simple DLL which is executed from IIS through a webpage. Could anyone one tell me why I can't create a window in this DLL. I'd like to create a window, render something on it then grab the image and send it back to the client through IIS. The moment I issue a CreateWindow call and run the dll from a browser it hangs.
Sam.
|
|
|
|
|
I have linked dynamic linked library myfunctions.lib file in my project by setting its path in Project/Settings/Link/Input. And I have to place myfunctions.dll either in the same folder of my project's exe or in the system directory.
Can any one suggest me what should do ? if I want to place that myfunctios.dll in some other folder??
|
|
|
|
|
chandni_chandrakant_maheta wrote: Can any one suggest me what should do ?
About what?
chandni_chandrakant_maheta wrote: if I want to place that myfunctios.dll in some other folder??
What other folder?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|