|
Some more info on my setup. I'm running Visual Studio Express 2008 and I'm currently using a Windows Form Application.
I really just want to know how to update the form from outside the form (if that makes sense).
I thought this might be the answer, but I'm not familiar with properties:
http://msdn.microsoft.com/en-us/library/cakx2hdw(v=vs.80).aspx#Y360
Thanks.
|
|
|
|
|
The Run() method is creating the message queue and generating the main application window. You probably need to read up on how Windows manages messaging between windows. You can still send commands through, it's handled by the framework so you really can't "see" the message pump. You just have to define the messaging interface.
|
|
|
|
|
Good morning. I am having a challenge deriving a connection string from my App.config. It is laid out for a special way of connection to SQL Server and Teradata, and using AppSettings is not possible. I would like to query for the value using LINQ or Lamda, but I don't have a great deal of experience in either.
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="UPCAppSettings">
<section name="DEVELOPMENT" type="MyCompanyProvident.iServices.Common.ConfigurationHandler.UPCAppSettingsHandler, MyCompanyProvident.iServices.Common.ConfigurationHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" allowLocation="true" allowDefinition="Everywhere"/>
<section name="PRODUCTION" type="MyCompanyProvident.iServices.Common.ConfigurationHandler.UPCAppSettingsHandler, MyCompanyProvident.iServices.Common.ConfigurationHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" allowLocation="true" allowDefinition="Everywhere"/>
</sectionGroup>
<sectionGroup name="MyCompany.Enterprise.Configuration">
<sectionGroup name="DEVELOPMENT">
<section name="MyCompany.appSettings" type="System.Configuration.NameValueSectionHandler" />
<section name="MyCompany.Enterprise.Data.Sources" type="MyCompany.Enterprise.Data.Sources, MyCompany.Enterprise, version=3.5.0.0, culture=neutral, publicKeyToken=01021d914afa5758" />
<section name="MyCompany.Enterprise.Security.ServiceAuthorization" type="MyCompany.Enterprise.Security.Authorization.ServiceAuthorizationConfigurationSection, MyCompany.Enterprise, version=3.5.0.0, culture=neutral, publicKeyToken=01021d914afa5758" />
<!-- Insert your custom sections here -->
</sectionGroup>
<sectionGroup name="PRODUCTION">
<section name="MyCompany.appSettings" type="System.Configuration.NameValueSectionHandler" />
<section name="MyCompany.Enterprise.Data.Sources" type="MyCompany.Enterprise.Data.Sources, MyCompany.Enterprise, version=3.5.0.0, culture=neutral, publicKeyToken=01021d914afa5758" />
<section name="MyCompany.Enterprise.Security.ServiceAuthorization" type="MyCompany.Enterprise.Security.Authorization.ServiceAuthorizationConfigurationSection, MyCompany.Enterprise, version=3.5.0.0, culture=neutral, publicKeyToken=01021d914afa5758" />
<!-- Insert your custom sections here -->
</sectionGroup>
</sectionGroup>
</configSections>
<MyCompany.Enterprise.Configuration>
<LOCALDEVELOPMENT>
<DEVELOPMENT>
<MyCompany.Enterprise.Data.Sources>
<DataSource key="TDConnKey" provider="Teradata" connection="Data Source=TDDEV;Database=MyProject_ddbo;Integrated Security=False;">
<CredentialStore appName="MyCompany.MyProject.DataAccess" credentialName="MyProject" />
</DataSource>
<DataSource key="SQLConnKey" provider="SqlServer" connection="Data Source=iServDev;Initial Catalog=FrameworkDB;Integrated Security=True" />
</MyCompany.Enterprise.Data.Sources>
</DEVELOPMENT>
<PRODUCTION>
<MyCompany.Enterprise.Data.Sources>
<DataSource key="TDConnKey" provider="Teradata" connection="Data Source=TDDEV;Database=MyProject_ddbo;Integrated Security=False;">
<CredentialStore appName="MyCompany.MyProject.DataAccess" credentialName="MyProject" />
</DataSource>
<DataSource key="SQLConnKey" provider="SqlServer" connection="Data Source=iServProd;Initial Catalog=FrameworkDB;Integrated Security=True" />
</MyCompany.Enterprise.Data.Sources>
</PRODUCTION>
</MyCompany.Enterprise.Configuration>
<appSettings>
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="amqmdnet" publicKeyToken="DD3CB1C9AAE9EC97" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.0.3" newVersion="1.0.0.3" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>
Thank you, WHEELS
|
|
|
|
|
Wheels012 wrote: I would like to query for the value using LINQ or Lamda, but I don't have a great deal of experience in either.
Why would you want it in "LINQ or Lambda"? (Without using the "it looks cool" argument)
A XmlDocument could be used, just looping nodes and returning the desired value.
Bastard Programmer from Hell
|
|
|
|
|
That is a good idea. I'll give it a shot. Thank you.
|
|
|
|
|
after learning the rule of C++,i still could not write a beautiful program like MSM or QQ, what should i do ? Shall i learn MFC or others ?i want to use SDK
|
|
|
|
|
First decide which language you wish to use, and then read books, check the internet for useful resources. Take a look at some of the articles[^] here on CodeProject, you will find many useful samples and tutorials.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Those are web based chats... so you should probably learn about doing web (or cloud) based applications and their relevant tools/frameworks. You can do it with C++ as well, but at that point you're probably working at a lower level than you have to.
|
|
|
|
|
template <typename String1>
void CompareText()
{
GUESSWHAT<String1> comparator;
String1 val1 = "abc";
String1 val2 = "xyz";
ISSAME(comparator(val1, val2), true);
}
ISSAME is the macro which can takes 2 vals.
Please let me know the meaning of "comparator".What is it(Function / object / Declaration)?
Also please let me know the declaration & defination of GUESSWHAT.
|
|
|
|
|
Member 1544087 wrote: Please let me know the meaning of "comparator".What is it(Function / object / Declaration)?
Looks like a function.
Member 1544087 wrote: Also please let me know the declaration & defination of GUESSWHAT.
Looks like a macro, but since you have not provided its definition we can only guess.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I have to write defination of GUESSWHAT...
I am not having it with me.
I think, its a template. But I am not sure, how it should be declared.
|
|
|
|
|
Member 1544087 wrote: I have to write defination of GUESSWHAT...
So I guess it's your homework or college assignment, which means you should have some lecture notes that explain what is required. As I said before we cannot guess what you need to provide based on this information. The best I can suggest is that you read up on templates[^] to get some possible answers.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
hi:
i overload the operator new, codes shown as below:
void * __cdecl operator new(unsigned int size, const char *file, int line)
{
void *ptr = (void *)malloc(size);
return ptr;
}
and when i want to create a class object
CTest::CTest()
{
int a = 0;
}
CTest::~CTest()
{
int b = 0;
}
int main()
{
CTest* test = new CTest;
delete test;
return 0;
}
it is very obvious that i overload the operator new by malloc, so when i use the overloaded new operator to create a class object, the CTest's construction should not be called, while the result is complete opposite. And
my question: why the class's construction function can be called when i create it by malloc but not new?
|
|
|
|
|
I think you need to make your overload a member of the CTest class; see here[^] for further details.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Voted a 4: although you're right about the class operator new being called first, it will eventually call the global new within it, don't think the compiler allows you to dodge the constructor with the new keyword. See the link I provided below...
It's really a good question because I never tried to do this before.
|
|
|
|
|
Albert Holguin wrote: it will eventually call the global new within it
This is all explained in the MSDN link I provided in my answer.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Overloading operator new only affect how memory is allocated. The constructor of your class is always called.
By the way, it has nothing to do with C++/CLI and thus, it is in the wrong forum.
Philippe Mori
|
|
|
|
|
|
It is defined by the standard to works that way. By the way, why would you wany to override operator new. It is hard to do correctly and efficiently.
And it C++, it never a good idea to create an object without calling its constructor. Thus why you would want it that way?
Also, if you override new, then you should probably override delete also to have a matching implementation.
Philippe Mori
|
|
|
|
|
1. Can I pass the CommVariant to other function, when not created using new ?
2. Should I free it/delete expecitly some where ?
3. Is it safe ?
<pre>CComVariant comVariant;
comVariant.vt = VT_I4;
comVariant.intVal = 10;
SendComVariantToOtherFunction(comVariant);
Thanks in advance!!
|
|
|
|
|
I'm new to C++ and am running into another hicucp I'm hoping someone can help me with. I'm looking to change the opacity on a form when the mouse enters it (to 100%), and then dim it again when the mouse leaves the Windows form. I can almost get things to work, but I'm seeing oddities that I think are due to the fact that it "enters" other controls that are on the form. Here's what I've been tinkering around with:
private: System::Void MyForm_MouseHover(System::Object^ sender, System::EventArgs^ e) {
this->Opacity = 1.00;
}
private: System::Void MyForm_MouseLeave(System::Object^ sender, System::EventArgs^ e) {
this->Opacity = 0.50;
}
private: System::Void MyForm_MouseEnter(System::Object^ sender, System::EventArgs^ e) {
this->Opacity = 1.00;
}
Can someone explain to me how I can prevent my code from repeatedly reading things until the cursor leaves the entire form?
Thanks!
|
|
|
|
|
I NEED HELP WITH THE FOLLOWING:
Write a class called Thermometer. The thermometer should have the following features:
• Return the current temperature in either C or F (conversion)
• Reset the temperature to zero (if the current scale is C) or 32 (if the current scale is F)
• Set the scale of the thermometer to either C or F
• Set the temperature
• Return the current scale
• Provide a copy constructor to make a copy of a Thermometer
All data members of your class should be private. You should include a constructor to initialize the Thermometer object to 0˚ C, as well as a constructor that accepts a temperature and scale to initialize to. You will also need a copy constructor.
|
|
|
|
|
What exactly do you need help doing?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I need help with the copy constructor.
|
|
|
|
|
So, what's the problem ?
This looks like a nice homework for entry level programming.
I assume you have course notes, documentation, discuss the problem with your friends and class mates, ask questions to your teacher and/or lab assistant.
Watched code never compiles.
|
|
|
|