|
mikobi wrote: How can I fill my Dataset and set Datasource
Have you looked at the scores of .NET Database Articles here on CodeProject?
|
|
|
|
|
CAn you give me the link.
|
|
|
|
|
Hello Sir
I am very happy because for the first time I print in Visual c++ NET with report. This what I do:
SqlConnection^ cprl = gcnew SqlConnection();
cprl->ConnectionString = "Persist Security Info=False;Integrated Security=SSPI;database=payroll05;server=sem;Trusted_Connection=Yes;" ;
cprl->Open();
Ds_report^ data = gcnew Ds_report();
SqlDataAdapter^ adapt = gcnew SqlDataAdapter();
SqlCommand^ Cmd = gcnew SqlCommand();
Cmd->CommandText = "select* from ficag21";
Cmd->CommandType = CommandType::Text;
Cmd->Connection = cprl;
adapt->SelectCommand::set(Cmd) ;
adapt->Fill(data,"ficag21");
rptsearchsig->SetDataSource(data);
rptsearchsig->Load("C:\\Documents and Settings\\miki\\Mes documents\\Visual Studio 2005\\Projects\\payroll\\payroll\\rp_signal.rpt");
rptsearchsig->PrintToPrinter(1,true,0,65500);
It's very simple but I take three days to do it.
I will send you my article to explain well for helping others that are in the same difficult.
Thanks to all halp me
|
|
|
|
|
Hi,
i would get my Mac adresse, Please help me to resolve this problem
Thank you verry mutch
|
|
|
|
|
Here's an example using WMI to get the MAC addresses for all the "Ethernet 802.3" adapters on
the system:
#using <System.Management.dll>
using namespace System::Management;
...
ManagementObjectSearcher searcher("SELECT Name,MACAddress FROM Win32_NetworkAdapter WHERE AdapterType = 'Ethernet 802.3'");
ManagementObjectCollection::ManagementObjectEnumerator^ enumerator = searcher.Get()->GetEnumerator();
while (enumerator->MoveNext())
{
Console::WriteLine(enumerator->Current["Name"]);
Console::WriteLine(" {0}", enumerator->Current["MACAddress"]);
}
Mark Salsbery
Microsoft MVP - Visual C++
"Remember the five Ds of dogeball: Dodge, Dip, Duck, Dive, and Dodge."
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi,
Thank you verry mutch for your answer, i work with C++ CLi and it doesn't know using namespace System::Management;
best regards
|
|
|
|
|
abbd wrote: it doesn't know using namespace System::Management;
What error are you getting?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Remember the five Ds of dogeball: Dodge, Dip, Duck, Dive, and Dodge."
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
which probably means you should "Add a reference" to System.Management.dll to your project
|
|
|
|
|
|
Which language are you coding in? This forum is for dot net cpp stuff. Whatever the case you'll probably need to provide some more info or post some small sections of your code. I've been doing some UDP stuff the last few months so I might be able to help
|
|
|
|
|
I would suggest that you post this in the Visual C++ forum and enclose the code inside
tags, or click the "Ignore HTML tags in this message" check box so that its easier to read
|
|
|
|
|
I'm not sure I'm understanding your problem, but do you have your recvfrom() call in a loop? If you don't, you'll just get one datagram and your thread function will continue to whatever's next.
|
|
|
|
|
I am using Visual c++ NET 2005
After creating report with Crystal report and create field on it(ADO.NET), how can I set DataSource programmatically on ReportDocument?
-- modified at 13:08 Thursday 19th July, 2007
|
|
|
|
|
How to programatically verify that an assembly has been installed in the global assembly cache??
|
|
|
|
|
|
Thanks, it was indeed helpful.
|
|
|
|
|
We have some static libraries created long time back say 10/15 yrs back.
We have build all the libraries in visual studio 2005.
But when we create a managed C++ application and try to use classes from the static libraries , the application just crashes with no traces as to why did the application crash.
Application crashes in dbgheap.c.
the static libraries which we use have reference to ATL as well.
With the same set of project settings if a create MFC application in Visual studio 2005 everything seems to be working fine.
Questions:
1. Is it possible for managed C++ application to use static libraries , if yes then what is to be done.
2.What are the options use a static library in managed code.
|
|
|
|
|
I have not used static linking for years. If it turns out there is some problem with that you might consider turning the libraries into DLLs. We have several projects using old code from DLL libraries that work just fine.
|
|
|
|
|
Ah, I've been reading this forum for months, waiting for a question I could actually answer.
At least, I hope I can answer it. If, when you say "managed C++", you actually mean C++/CLI, then the answer is yes. I have written a couple of test applications that statically link one of my native-code libraries to a C++/CLI application that uses managed code. I had some trouble getting static variables in the library to initialize properly, which caused various crashes. I was an MSDN subscriber at the time, and I got a solution from the MSDN-only forums in a matter of days -- I was impressed.
If you're trying to link to a C++/CLI application and you have static variables in your library, I'd be happy to send you the workaround. If you're using the old Managed C++ or don't have any static variables in your library, then I can't help you, sorry.
|
|
|
|
|
ok, so I am using the function PostMessage(msg, wParam, lParam) TWICE in succession:
if (m_pSelectionDlg->GetSafeHwnd()) {
m_pSelectionDlg->PostMessage(WM_ADDENTITY,wParam, lParam);
static CWnd *pWnd;
if ( (pWnd = FindWindow("MyAppClass",0)) != NULL)
pWnd->PostMessage(WM_ADDENTITY,wParam,lParam);
}
for the first call (#1), wParam = 1 and lParam = 0.
for the second call (#2), I step inside the PostMessage() function and wParam = 0 and lParam = 0. Why?
|
|
|
|
|
I don't believe you
You haven't left out any code that could trash the stack (which is where I presume wParam and
lParam are)?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
Nope, that is the code, as is.
The wParam and lParam values are the same after first (#1) call, but when it goes inside the PostMessage() function, I look at it to see that wParam is zero and lParam is zero.
|
|
|
|
|
1st - sorry for replying to my own post...
2nd - Why do I have to do something like this?? Going into PostMessage() #2, my wParam and lParam values are the same as before.
if (m_pSelectionDlg->GetSafeHwnd()) {
m_pSelectionDlg->PostMessage(WM_ADDENTITY,wParam, lParam);
static CWnd *pWnd;
UINT myWParam;
LONG myLParam;
myWParam = wParam;
myLParam = lParam;
if ( (pWnd = FindWindow("MyAppClass",0)) != NULL)
pWnd->PostMessage(WM_ADDENTITY,myWParam,myLParam);
}
I added the "copy of" wParam and lParam as a test, and voila, the second call to PostMessage() worked and received the correct wParam/lParam values.
This seems too hokey...
|
|
|
|
|
Be careful using UINT and LONG for the types of wparam and lparam.
It's safer to use WPARAM and LPARAM or UINT_PTR and LONG_PTR.
Saves changing it in the future when everything's 64-bit
I still have no idea how your variables could change between the PostMessage calls.
How are you checking....stepping into the API assembly code?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
Yes, setting a break point and then step into PostMessage(). I "tricked it" by making a copy of the variables and then supplying these copies to my second call. I'll check the UINT/LONG, WPARAM, suggestion you mentioned.
Thanks.
Johnny
|
|
|
|