|
This is the C++/CLI forum. Please post your question in the appropriate forum.
|
|
|
|
|
I am writting a database managment application. Everything is pretty much coded up and the last thing I am having difficulties with is the printing. I have read on MSDN that I should use the combination of printdialog and print document. The print document should describe the data that needs to be printed. That's where the problem resides. What is the printDocument expecting- formName, a list of members on the form, or something else???
While trying to get that going I have come across some other code which I manually had to enter the coordinates of data items that need to be printed to the screen. I dislike that method as it involves assigning static locations of printing items, and can sometimes overwrite text over other text.. The whole approach is very messy. If I stick wiht this approach I will need info on how to start a new printing page.
Is there anyone on here that can show me how to get the printing of my forms to be automated, dynamic, something like WYSIWYG.
Thanks in advance,
Arian
-- modified at 21:39 Monday 20th February, 2006
|
|
|
|
|
Im trying to develop authentication daemon using CRAM-MD5(MYSQL).Honestly,im not a good programer.Its just a assignment given to me.Is there any good soul,who can help me with any stuff like tutorials,sample code,tips,libraries to use etc.
Thanks in Advance
Blessed
|
|
|
|
|
I need the source code to design and implement a simple multi-threaded server to concurrently process multiple client requests using the Solaris pthread library as part of course work for my university. The server must support concurrent operation since many independent clients can simultaneously send requests to the server. I am to use thread pools, shared buffer, client threads, dispatcher threads and worker threads as part of the software components for the server. I don't know anyone who knows much about this . Any help on obtaining the source code will be very much appreciated. Thank You
|
|
|
|
|
Hi All,
I need to implement this,
typedef struct
{
T1 m;
T2 m;
T3 m;
........
}XX;
XX a;
....
note T1,T2,T3... has no basic class, I hope
a function can auto visit the data member one by one like this
for(int pos=0; pos
|
|
|
|
|
I don't know what you want but here is my answer:
template<typename T, int INDEX>
struct XX
{
T m[INDEX];
};
Also, this post belongs in the Visual C++ forum.
-- modified at 12:16 Sunday 19th February, 2006
|
|
|
|
|
Since you placed your posted problem here, you get a C++/CLI answer:
using namespace System;
using namespace System::Reflection;
public ref struct Record
{
String ^ name;
int age;
};
int main(array<System::String ^> ^args)
{
Record ^ rec = gcnew Record;
rec->name = "George Washington";
rec->age = 274;
array<FieldInfo ^> ^ fieldInfo;
Type ^ recordType = Record::typeid;
fieldInfo = recordType->GetFields(
static_cast<BindingFlags>(
BindingFlags::Public | BindingFlags::Instance));
for (int i = 0; i < fieldInfo->Length; ++i)
{
Console::WriteLine("{0} = {1}",
fieldInfo[i]->Name,
fieldInfo[i]->GetValue(rec));
}
return 0;
}
-- modified at 13:34 Sunday 19th February, 2006
|
|
|
|
|
Hi!
I'm currently trying to get a program working that's supposed to display only a message
meaning without a window.
I've retrieved from various locations source code for this but every time there's
at least one error in the compile.
I'm using Borland C++ 5.5 as my compiler in a DOS-environment.
This is the source of the code that isn't working:
<br />
msgonly.cpp:<br />
<br />
#include <windows.h><br />
<br />
LRESULT CALLBACK MainWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);<br />
<br />
int APIENTRY WinMain(HINSTANCE hInstance,<br />
HINSTANCE hPrevInstance,<br />
LPSTR lpCmdLine,<br />
int nCmdShow)<br />
{<br />
MSG msg;
WNDCLASSEX wcx;
<br />
ZeroMemory(&wcx,sizeof(WNDCLASSEX));<br />
wcx.cbSize = sizeof(WNDCLASSEX);
wcx.style = NULL;<br />
wcx.lpfnWndProc = (WNDPROC)MainWndProc;
wcx.cbClsExtra = 0;
wcx.cbWndExtra = 0;
wcx.hInstance = hInstance;
wcx.hIcon = NULL;
wcx.hCursor = NULL; <br />
wcx.hbrBackground = NULL;<br />
wcx.lpszMenuName = NULL;
wcx.lpszClassName = "MessageOnly";
wcx.hIconSm = NULL;
<br />
if (!RegisterClassEx(&wcx))<br />
return 0;<br />
<br />
hwndMain = CreateWindowEx(WS_EX_LEFT, <br />
"MessageOnly",
NULL,
0,
0,
0,
0,
0,
HWND_MESSAGE,
0,
hInstance,<br />
0);<br />
<br />
if (!hwndMain)<br />
return 0;<br />
<br />
ShowWindow(hwndMain,SW_SHOW);<br />
while (GetMessage(&msg,NULL,0,0))<br />
{<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
<br />
return 0;<br />
}<br />
<br />
LRESULT CALLBACK MainWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)<br />
{<br />
switch (msg)<br />
{<br />
case WM_DESTROY:<br />
PostQuitMessage(0);<br />
break;<br />
default:<br />
return DefWindowProc(hwnd,msg,wParam,lParam);<br />
}<br />
return 0;<br />
}<br />
This is the error I get:
<br />
Error E2451 msgonly.cpp 33: Undefined symbol 'hwndMain' in function __stdcall WinMain(HINSTANCE__ *,HINSTANCE__ *,char *,int)<br />
Can anyone help me with this?
Thanks!
|
|
|
|
|
Hmmm... the include's supposed to be
<br />
#include < windows . h ><br />
I don't know why it never displays this kind of thing...
|
|
|
|
|
At least you have to declare the hwndMain anywhere in your code. For example on the top of the WinMain function as: HWND hwndMain; !
THis is typical for beginners. You have do read and understand the error or warning messages from your compiler.
|
|
|
|
|
That seems to do the trick.
Thanks!
I might have made a typical novice mistake, but at least I've learned something
|
|
|
|
|
Hi,
Let me explain using a very simple example: finding all combinations of 2
from a set of 6 letters {A, B, C, D, E, F}. The first combination is AB and the
last is EF
The total number of possible combinations is: n!/(r!(n-r)!)=6!/(2!(6-2)!)=15
combinations
Let me show you all the combinations first:
AB
AC
AD
AE
AF
BC
BD
BE
BF
CD
CE
CF
DE
DF
EF
I want to print all the comibinations..........
Regards
James
|
|
|
|
|
|
void PrintCom(char *letterSet,int setLen)
{
int NoOfCom=0;
for(int i=0;i<setLen;i++)
{
for(int j=i+1;j<setLen;j++)
{
cout<<letterSet[i]<<letterSet[j];
NoOfCom++;
}
cout<<endl;
}
cout<<NoOfCom<<endl;
}
the letterSet is a pointer of the set array,setLen is the length of the array.
|
|
|
|
|
Hi, i use srand ( ) in order to fill in an array with values but i want to esure that each value will appear only one time.
Is there something i can do with the function to avoid comparing array elements to check it?
Thanks
chrizpl
|
|
|
|
|
Someone might have a clever way of doing that but here is my suggestion that avoids checking the "random" array. Create a KeyValue type collection that contains the number range values as keys (0, 1, 2, 3, etc.) and a value initially false. Before adding a random number in the "random" array, search the KeyValue collection with the random number. If the value is false, add it to the "random" array and then set the value to true.
-- modified at 7:13 Saturday 18th February, 2006
|
|
|
|
|
Can you be more clear please? What i want to do is to fill up a 2-d[3][3] array with numbers from 0-8. I want each number to be appear in my array but only one time. Each time i run my program i want the sequence of the numbers to change.
example of how i want to look like my array is: 3 5 7
2 1 0
4 6 8
chrizpl
|
|
|
|
|
Sounds like a homework assignment and you are using native C++ (not C++/CLI). Since you can not check the array that has the numbers randomly placed without repeats. My suggested solution still stands with a modification. If the number range is 0 through 8, create a boolean array that holds 9 boolean numbers set to false. When your "srand function expression" creates a random number, check it against the array using its index. If the result is false, add the number to the random arranged array and set the indexed cell to true.
Think of your randomly arranged array as a shopping cart, and your shopping list is a list of numbers to be found and placed in the shopping cart. As you place the number in the cart, you scratch the number out so that you won't place that number in the cart again.
I gave you too much. If you can not figure out what I gave you. You need to review what you have not learned well.
-- modified at 9:00 Saturday 18th February, 2006
|
|
|
|
|
TBD
modified 28-Jan-14 19:19pm.
|
|
|
|
|
Ever heard about a nice thing called google ?
|
|
|
|
|
|
Hello people.
like Windows::Forms::Form->Controls holds the control collection. I need to know what controls lies on another application.
Any Idia ?
|
|
|
|
|
Nevermind. I found the answer. It's two APIs:
EnumChildWindow and RealGetWindowClass.
|
|
|
|
|
Thanks guys, i managed finally to do the program!
|
|
|
|
|