|
I am using Visual c++ NET 2005
Who can I set focus to a control in the same form ?
|
|
|
|
|
RTFM
|
|
|
|
|
When in a native c++ class, in a /clr project, stepping through is getting out of sync of where it should be.
i.e.
1 if(fileSpec.GetLength()==0)
2 {
3 printf("You must specify a filename!\n");
4 return 1;
5 }
I put a breakpoint on line 1. Then F11 to step into. The if statement returns false and so it should step to 5 or beyond. Instead it stops on 4.
Any ideas why?
|
|
|
|
|
Hello,
Have you tried deleting all .ncb and .suo garbage, and rebuilding all?
|
|
|
|
|
Hi,
When I am trying to automate MS Word (32 bit) from a NT Service (32 bit). The word runs as a 64 bit application (as evident from the task manager).
But if the same code is run as a thread from a Windows application word runs as 32 bit.
How can I automate word to run as 32 bit from the NT sevice??
Thanks,
Indra
|
|
|
|
|
You;re trying to automate Word using C++ and .NET ?
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 )
|
|
|
|
|
Christian Graus wrote: You;re trying to automate Word using C++ and .NET ?
No, using C++ and COM.
Code I am using:
VARIANT root[64] = {0}; // Generic IDispatchs
VARIANT parm[64] = {0}; // Generic Parameters
VARIANT rVal = {0}; // Temporary result holder
int level=0; // Current index into root[]
// Initialize the OLE Library...
OleInitialize(NULL);
// Line 1: Set oWord = CreateObject Word.Application
CLSID clsid;
CLSIDFromProgID(L"Word.Application", &clsid);
HRESULT hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER|CLSCTX_INPROC_SERVER, IID_IDispatch, (void **)&rVal.pdispVal);
rVal.vt = VT_DISPATCH;
VARIANT oWord = {0};
VariantCopy(&oWord, &rVal);
VariantClear(&rVal);
// Line 2: oWord . Visible = 1
rVal.vt = VT_I4;
rVal.lVal = 0;
VariantCopy(&root[++level], &oWord);
hr = AutoWrap(DISPATCH_PROPERTYPUT, NULL, root[level].pdispVal, L"Visible", 1, rVal);
VariantClear(&root[level--]);
VariantClear(&rVal);
// Line 3: oWord . Documents . Open C:\\Test.doc
VariantCopy(&root[++level], &oWord);
hr = AutoWrap(DISPATCH_PROPERTYGET|DISPATCH_METHOD, &root[level+1], root[level++].pdispVal, L"Documents", 0);
The purpose of the AutoWrap function in this sample is to wrap the calls for GetIDsOfNames and Invoke to facilitate automation with straight C++.
|
|
|
|
|
indra20 wrote: No, using C++ and COM.
OK, then you're in the wrong forum. Try the Visual C++ forum.
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 )
|
|
|
|
|
Hi,
I have a C++ (Borland 5.02 - I know is old stuff...anyway) I have function where I can print reports. Now what I need to to modify this function to instead of printing to a printer I need to save that as MDI or PDF file, but I want to bypass the Save As dialog box because I have several hundreds of reports to print. How can I do that? Please help!!!
Flavio
|
|
|
|
|
Borland does not support .NET, therefore you're in the wrong forum. Even in hte right forum, I'm not sure how many people can offer Borland specific help.
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 )
|
|
|
|
|
For managed C++ what is the difference between:
using
#using
using namespace
?
Thanks in advance
|
|
|
|
|
A quick look with the F1 key yields:
"The #using Directive...Imports metadata into a program compiled with /clr."
"The using directive allows the names in a namespace to be used without the namespace-name as
an explicit qualifier."
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey All,
I've run into a problem where under Visual Studio 2005 if a crash occurs in my managed code, I simply get the MS .NET Framework dialog box. Of course it tells me to make sure the reg key is set, debugging info is turned on and that my config file sets <system.windows.forms jitdebugging="true">. I seem to be doing everything, yet I can't get the debugger to open.
Any ideas? Am I missing some other step, or does mixed code fail to invoke the debugger?
Thanks!
Ant
|
|
|
|
|
Hi,
I have some doubts in Virtual functions.
What is the use of Virtual Functions?
In which scenario, virtual functions will be useful ?
For what real time problems, virtual function is preferred?
Please clear my doubt.
Thanks,
Arun AC
|
|
|
|
|
It's all about polymorphism!
A Googly search on "C++ virtual functions" yields billions of articles on the subject (ok, maybe
not that many).
For example: Polymorphic and Virtual Functions in C++[^]
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
After designing my report using Dataset(payroll05DataSet) of my project, How can I fill my Dataset and set Datasource so i can see data on my report.
-- modified at 13:29 Friday 20th July, 2007
|
|
|
|
|
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
|
|
|
|
|