|
jonsey29847 wrote: my thinking was that once assignment was made I no longer needed tcCode etc
DTCodes[i].Code = tcCode;
ZeroMemory(tcCode, 0x06);
u no longer needed tcCode, but i think u need DTCodes[i].Code, since both points to same address clearing tcCode, clears DTCodes[i].Code.
and also ur allocating tcCode once outside the for loop, hence for all i, DTCodes[i].Code points to same tcCode.
assigning doesnot copies a C-Style string.
the following change may be useful,
struct DTC{
char Code[0x06];
...
}DTCodes[0x10];
and copy the string to DTCodes[i].Code[len++] = tcInputData[0];
|
|
|
|
|
Thanks very much, I have changed my code and it work very nicely.
|
|
|
|
|
Thanks, I made the change and it works very well!
|
|
|
|
|
I have a CDialogBar which uses a dialog resource, and the resource has some push buttons and a list box. I recently decided that I wanted the dialog bar to also have a tool bar at the top of its window. I've tried adding a CToolBar object, as well as tried adding a CToolBarCtrl, but I'm not able to get the tool bar to display.
I tried the same technique with adding a CToolBar object to a CDialog, and that worked fine (as did CToolBarCtrl), but when I try the same code within a CDialogBar, nothing appears.
Any suggestions? I've searched but I haven't found anything on the subject. I've found tips on how to add a CToolBar to a CDialog, but not how to add a CToolBar (or a CToolBarCtrl) to a CDialogBar.
Thanks,
Jeff
|
|
|
|
|
i am new on c++
i need to create a function with 2d array argument.
i mean i can use the integer numbers in a 2d array in my function.
And i also need to know how i can copy the information from the textboxes to a 2d array in vc++.
i hope you will help me.
thanks
|
|
|
|
|
Adnan Merter wrote: need to create a function with 2d array argument.
i mean i can use the integer numbers in a 2d array in my function.
for instance
int f(int a[3][2])
{
int i,j;
for(i=0; i<3; i++)
for(j=0; j<2; j++)
printf("a[%d][%d]=%d\n", i, j, a[i][j]);
return 0;
}
Adnan Merter wrote: And i also need to know how i can copy the information from the textboxes to a 2d array in vc++.
What is your difficulty about?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
i have an array like x[5][5]
and i need to use it as an argument in my function i know how i use 1d array. i can it by using pointers.
void display (int *p, int size)<br />
{<br />
int i;<br />
<br />
for (i = 0; i < size; ++i)<br />
printf("%-5d%-5d \n", p[i],&p[i]);<br />
}<br />
<br />
int main()<br />
{<br />
int a[5] = {3, 8, 7, 6, 10};<br />
<br />
display(a, 5);<br />
return 0;<br />
}
but i dont know how ican use 2d arrays
|
|
|
|
|
For instance:
void display (int *p, int size0, int size1)
{
int i, j;
for (i = 0; i < size0; i++)
for (j = 0; j< size1; j++, p++)
printf("%-5d \n", *p );
}
int main()
{
int a[2][5] = {{3, 8, 7, 6, 10}, {6, 16, 14, 12, 20}};
display((int *)a, 2, 5);
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi all
i want to simulate the ctrl + alt + delete keys
I am facing problem with this code. I able to get the reference of the "winlogon" desktop but am unable to simulate the ctrl + alt + delete keys.
can any one help please.
HDESK desktop;
ofstream myfile;
HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
myfile.open ("c:\\desktop.txt");
// Attempt to open the named desktop
esktop = OpenDesktop("Winlogon", 0, FALSE,
DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
DESKTOP_SWITCHDESKTOP | GENERIC_WRITE);
if(desktop!=NULL){
myfile << "desktop found.\n";
}else{
myfile << "desktop not found.\n";
}
HWND hwndCtrlAltDel = FindWindow("SAS window class", "SAS window");
if (hwndCtrlAltDel == NULL) {
myfile << "SAS window not found.\n";
hwndCtrlAltDel = HWND_BROADCAST;
}
PostMessage(hwndCtrlAltDel, WM_HOTKEY, 0, MAKELONG(MOD_ALT | MOD_CONTROL, VK_DELETE));
HWND logonwindow = FindWindow("", "Log On to Windows");
if (logonwindow == NULL) {
myfile << "logon window not found.\n";
}
myfile.close();
|
|
|
|
|
|
Can any on tell me how to remove borders from a Combobox. I tried SetWindowRegion, it worked for Edit control, but it did not work with Combobox
Thanx
Md. Humayuon Kabir Hemoo
modified on Saturday, February 16, 2008 12:55 PM
|
|
|
|
|
You could try removing any border styles from the window styles associated with the
control.
If a control's painting implementation ignores the style then you have no choice but to draw
the control yourself.
MArk
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
Thanks for your response. It seemes I need to draw the combobox my self. But don't you think SetWindowRegion should set the painting area of a control?
Humayoun
Md. Humayuon Kabir Hemoo
|
|
|
|
|
Humayun Kabir Hemoo wrote: But don't you think SetWindowRegion should set the painting area of a control?
Not necessarily. The control draws itself just like any other window.
Whether the control sets its own region or not, or honors any of the styles you
create it with, depends on the implementation.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I didn't know this before, thanx. By the way, removing WS_BORDER didn't work.
Md. Humayuon Kabir Hemoo
|
|
|
|
|
Do you want to customize combobox or remove border of it?
|
|
|
|
|
I want to remove the border.
Md. Humayuon Kabir Hemoo
|
|
|
|
|
So you can use of property window of combobox or use of ModifyStyle(....) for remove each style that you dont want it.
|
|
|
|
|
can we make any control(like edit box) as the standard output device so that the result of the process can b directly shown in that particular edit box without any interaction ..............i think it is possible when we run the procees using createProces() and pass appropriate arguements.......but i am not able to complete it
AbidBhat
|
|
|
|
|
This is a good place to start
Clickety[^] and then follow the yellow brick road.
I have beaten you, Rajesh.
Maybe could win the next race.
Sorry Rajesh, I just couldn't resist
codito ergo sum
|
|
|
|
|
BadKarma wrote: I have beaten you, Rajesh.
Maybe could win the next race.
Okay, you win this time. But, I've replied him, too.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
lol !!!!!!!!
Rajesh R Subramanian wrote: you win this time
that is because u expected this tomorrow
Rajesh R Subramanian wrote: He'll ask it again tomorrow
his trick is to ask before that
|
|
|
|
|
This[^] must help you.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Process started successsfully......but i want to display the output in an edit box rather than console window ..........how to do it
AbidBhat
|
|
|
|
|