|
Pranit Kothari wrote: Why it is at all needed more than one project in solution?
I create apps in functional blocks, like the database layer. I like to work on that and test it independently. So I have project and a solution as well.
Then I add the projects into the main solution.
|
|
|
|
|
Thanks for your answer.
What I have guessed from your answer is, suppose I have some set of classes that I am creating in one project and I will create another project and use that library. It it correct?
If yes, may I know how to use it? Is it related with assembly or namespace?
|
|
|
|
|
Pranit Kothari wrote: What I have guessed from your answer is, suppose I have some set of classes that I am creating in one project and I will create another project and use that library. It it correct?
Yes and no.
I use the term library to refer to a deliverable. An example is a logging library like log4cpp.
A deliverable has an independent project schedule, has its own requirements and users of the library determine which version to consume by moving the binary (compiled) form into their project.
An application however might have different layers or blocks. Each would likely have their own project. (I usually won't break into layers/blocks if there is only one code file even if there is a conceptual difference.)
On the other hand for something like a windows service I always break the 'service' code into a project that does nothing but provide the basic start/stop and uses another project (called something like 'App') which encompasses the entire functionality of the windows service. So a layout would look like
MyService
App
Service
OtherFunctionality
lib
MyOtherLibrary.dll
In the above the Service project refers to the App project and OtherFunctionality project and references the MyOtherLibrary.dll.
The App project refers to the OtherFunctionality project and references the MyOtherLibrary.dll as well.
Some very common functional blocks for me would be database layers, communication layers and business logic of different types. The App is also a block as it represents the application itself without requiring dependency specifically as a windows service. This makes it trivial to also deliver a stand alone console executable (which I always do as well.)
|
|
|
|
|
Thanks jschell. really nice explanation. Now I got it.
|
|
|
|
|
Usinrg selective instrumentation with Purify needed msvcrt.pdb 7.0.2600.5512,
where can I find it ?
Thanks in advance !!
|
|
|
|
|
Sounds like a question for a Purify forum. Purify install should include all the C-Runtime DLLs it requires. You could try debugging a c++ app built against that version of the runtime and in the debugger use the Microsoft symbol server to download the pdbs by a right-click on the module and download symbols from MS symbol server.
John
|
|
|
|
|
I found msvcrt.pdb under the Platform SDK on my machine.
|
|
|
|
|
Hallo,
I try to use the .NET 2.0 Framework in Visual Studio 2008 to open an excel File, write some data/cell style info in it, and show it to the user.
I use the Use Visual Studio 2008 C++/CLI to Automate Excel[^] Tutorial.
So I have something like that:
<pre>Excel::Application^ exApp = gcnew Excel::ApplicationClass();</pre>
but I have one big problem: IntelliSense code completion does not work, he does not find any options for exApp-> and I want to open a worksheet and I don`t know which variables the exApp->Workbooks->Open Function needs, for example.
Can someone tell me how I get the IntelliSense for the Managed Code to work?
Thank you!
|
|
|
|
|
I'm not sure that Intellisense for C++/CLI code ever worked very well in VS2008. That's one of the reasons it's not supported at all in VS2010.
See Rebuilding Intellisense in the vcblog for an explanation from Boris Jabes.
I recommend Visual Assist X to get intellisense for C++/CLI files.
John
|
|
|
|
|
I have a Windows Forms application that runs, when clicking on a button, a .exe console application. I know I can use System::Diagnostics::Process::Kill to exit it, and I want to do it when the user clicks on a Cancel button.
The problem I am encountering is that while the console application is running it is not possible to interact with the Windows Forms application.
Is there any way to run the process minimized or something similar?
|
|
|
|
|
piul wrote: it is not possible to interact with the Windows Forms application.
It is, unless you made it impossible through some code.
Show us the relevant code that deals with launching the console app.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
There it goes:
proc= gcnew System::Diagnostics::Process;
proc->StartInfo->RedirectStandardOutput = true;
proc->StartInfo->UseShellExecute = false;
proc->StartInfo->FileName = "..\\..\\..\\Tests\\ConsoleTest\\debug\\ConsoleTest.exe";
proc->OutputDataReceived += gcnew System::Diagnostics::
DataReceivedEventHandler (&Form1::StdoutHandler);
bool processStarted = false;
try
{
processStarted = proc->Start();
}
catch (Exception^ excp)
{
richTextBoxOutput->AppendText(excp->Message);
}
if (processStarted)
{
buttonCancel->Enabled = true;
proc->BeginOutputReadLine();
proc->WaitForExit();
buttonCancel->Enabled = false;
}
|
|
|
|
|
piul wrote: proc->WaitForExit();
this is a blocking call: the method waits, i.e. does not return, until the target process has exited. So if all the code shown is running on the main thread (say is part of an event handler, maybe a button click handler), then the main thread will sit there waiting , rather than handling all your Windows events (such as you clicking on the cancel button).
There are a couple of ways to solve your problem, the one I prefer is using an extra thread, probably a BackgroundWorker. Its DoWork handler would contain
proc->BeginOutputReadLine();
proc->WaitForExit();
or even a synchronous loop to read the output, no need to use asynchronous when you already have a dedicated thread.
BTW: you can't directly touch GUI Controls from inside DoWork, so you should enable the cancel button before you launch the BGW, and disable it inside the RunWorkerCompleted handler.
One alternative would be to use a timer (a System.Windows.Forms.Timer at best), that ticks say every 300 msec. Its Tick handler could check (no wait!) whether the process has exited, and if it has, disable the cancel button and stop itself.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
why should one needs to do this, I believe first line is enought. What makes the difference...
CString strCode(OtherString);
int i = 0;
while(str.GetAt(i) != '\0')
{
i++;
}
str = str.Left(i);
Thanks
|
|
|
|
|
I guess someone does not trust the CString constructor.
I must get a clever new signature for 2011.
|
|
|
|
|
Although not advisable a CString can contain embedded nulls.
So if one wants a string that doesn't have nulls, probably specifically in terms of length, and one isn't sure that nulls are not present (or one is sure) then one would need to do something like that.
Search for "embedded null" in the following.
http://msdn.microsoft.com/en-us/library/cws1zdt8.aspx[^]
|
|
|
|
|
I am new to windbg and I am analysing crash dump at some point I got below table as out put of !heap -s command, I want to dig deep and analyse futther can you please advice.
0:000> !heap -s
LFH Key : 0xeaafe2e0
Heap Flags Reserv Commit Virt Free List UCR Virt Lock Fast
(k) (k) (k) (k) length blocks cont. heap
-----------------------------------------------------------------------------
00150000 00000002 4096 3276 3292 183 37 5 0 0 L
00250000 00001002 64 56 56 2 1 1 0 0 L
00260000 00008000 64 12 12 10 1 1 0 0
00340000 00001002 64 28 28 3 1 1 0 0 L
00360000 00041002 1280 168 208 96 22 7 0 0 L
008b0000 00001002 1088 72 72 14 3 1 0 0 L
008d0000 00001002 64 28 28 2 1 1 0 0 L
00c80000 00001002 15424 5700 9744 323 41 53 0 6 L
03400000 00001002 64 24 24 3 1 1 0 0 L
0ff90000 00041002 1280 308 308 2 1 1 0 0 L
03520000 00001002 3136 612 688 577 6 4 0 0 L
0fff0000 00001002 64 32 32 2 1 1 0 0 L
121e0000 00001002 64 24 24 4 1 1 0 0 L
18fe0000 00001002 64 16 16 0 0 1 0 0 L
1a130000 00001002 64 16 16 3 1 1 0 0 L
1d9a0000 00001002 1024 1024 1024 1016 2 0 0 0 L
1dc30000 00001002 256 32 32 3 1 1 0 0 L
1f540000 00001002 256 12 12 1 1 1 0 0 L
1c090000 00001002 64 12 12 4 1 1 0 0 L
-----------------------------------------------------------------------------
modified on Tuesday, January 25, 2011 6:17 AM
|
|
|
|
|
|
Hello,
I am having trouble finding anything
about displaying a bitmap image within an activex
webpage.
Can anybody direct me to something useful ?
Thanks v much
Simon
|
|
|
|
|
Are you sure you are on the right forum?
Best wishes,
Navaneeth
|
|
|
|
|
Anyone had any experience adding GPS support to a managed C++ application?
I will be checking out the articles in the next couple of days but I would also like to here some experiences of what is possible and the extent of any difficulties. e.g. are GPS aware laptops becomming more common or does your typical laptop still need a connection to a GPS device or smart phone?
Ger
|
|
|
|
|
Ger Hayden wrote: are GPS aware laptops becomming more common
Even if it were true I would doubt there would be any way to validate it.
And without some qualification (probably severe) to restrict to a targeted market I would seriously doubt it.
|
|
|
|
|
Hi, I've been banging my head against the wall for a few days with this one, so if anyone has a solution, you would be my hero. What I'm looking for is a way that when a Form is FIRST created and shown, it is already in the minimized state. I'm already aware of putting an icon in the tray, but that doesn't work the way I need it to, it must start already minimized in the taskbar. I also cannot have it show up for a quick second and then minimize, which is the only thing I can seem to get it too do. I don't want to go into all the specifics as why my program needs to do this, just trust me, it does. Any help would be greatly appreciated! Thanks!
|
|
|
|
|
Set WindowState = Minimized in your form's properties.
I must get a clever new signature for 2011.
|
|
|
|
|
I cannot get the syntax for the cyclic list class I am working on.
In the following class you see that I have a property named CycItem .
This works, but I would like to have it be the default indexer so I can just use Item or [] .
Any help would be great.
#pragma once
using namespace System;
using namespace System::Collections::Generic;
using namespace System::Reflection;
namespace MG_Geo {
generic <typename T>
public ref class CycList: public List<T>
{
public:
CycList()
{
}
property T CycItem [int]
{
T get(int index) {
if (this->Count==0)
{
throw gcnew IndexOutOfRangeException("IndexOutOfRange Count = 0");
}
while (index < 0)
{
index = (this->Count + index);
}
if (index >= this->Count)
{
index = (index % this->Count);
}
return this[index];
}
void set(int index, T value) {
if (this->Count==0)
{
throw gcnew IndexOutOfRangeException("IndexOutOfRange Count = 0");
}
while (index < 0)
{
index = (this->Count + index);
}
if (index >= this->Count)
{
index = (index % this->Count);
}
this[index] = *value;
}
}
};
}
modified on Friday, January 7, 2011 6:22 AM
|
|
|
|