|
You're really in the wrong forum. You should generally ask C++ questions in the Visual C++/MFC forum[^]. This forum (.NET Framework) is for general managed code, e.g. Visual Basic or C#, non-language-specific questions.
That said, most likely you're trying to debug a release build. The optimizer has most likely optimized away the hr variable, leaving its value only in a variable. Or, if you're never writing to it, just replacing it everywhere it's used with the static value 0 (which is the value of S_OK).
Always debug a non-optimized, debug build of your application to begin with. It's important to test release builds but I'd generally only load one into the debugger if there's a problem that doesn't reproduce in the debug build.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hello,
I am new to .net framework. Previusoly i was working in VC++. When i see the applications in .net, all code is in ".h" file not in ".cpp" file.
Why this, i am confusing about this.
|
|
|
|
|
In C# (and VB.net as far as I know) you do not have seperate header and implementation files. You have only one (e.g. .cs on C#) for normal code. This file contains for example the class with its interface and implementation in one place.
There can exist several files when classes are marked partial (normally used for classes that are partly auto-generated).
regards
Urs
-^-^-^-^-^-^-^-
no risk no funk
|
|
|
|
|
I need a text editor with the ability of editing .RTF files (if not word files) . Something like TE Edit Control.(You can find it in http://www.subsystems.com site). But I want it to be free or have its crack ) I really need this for a project.
Best Regards , Hossein
|
|
|
|
|
devboycpp wrote: have its crack
So, you're a thief and you're hoping we will help you ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
devboycpp wrote: have its crack
If you are going to use this in your project, let me know of your organization name and project manager so that I can report them to Intellectual Property Rights organization of your country.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Since I do actually help people on the odd occasion....
Google
EditPad Lite
-= Reelix =-
|
|
|
|
|
This seems so silly, but,
I've been googling now for 2 hours and can't find an answer. Hope someone here can help.
I create a temp directory on the path Environment.SpecialFolder.LocalApplicationData combined with a session guid. No problem - the directory is created. The problem is that the 'Use folder type as a template:' (Explorer directory-properties-customize) is set by default on the create to 'Pictures and Videos' or 'Music' and I was wanting it to be set to 'All items'. (The folder look is incorrect on Process (verb 'open') explorer load.)
Any help for the call to change the folder type would be greatly appreciated. (I'm running on Vista with VS2005).
Thanks.
|
|
|
|
|
Strange Behavior with Generics:
When I define a Generic at class level with a constraint, I get a compile exception , however , when I implement Generic at method level with the same constraint , all goes well ...
Wondering , wether its a bug in generics or the bug lies in my way of interpretation
Have Tried to explain the problem below :
Case 1:
I have defined a abstract generic class and defined the generic type at class level , with a constraint . Below is the class definition.
public abstract class BaseVOMapper<T> where T:BaseVO
{
public abstract void Insert(BaseVO child , BaseVO parent );
public abstract void SaveChildrens(List<T> childListToPersist, BaseVO parentVO);
}
Below is the implementation o f the derived class , where FlightList is a List<FlightVO> & FlightVO: BaseVO & as per polymorphism ,I assume , I can pass List<FlightVO> where List<BaseVO> is expected.However , I endup getting the below error.
Argument '1': cannot convert from 'System.Collections.Generic.List<ValueObjects.FlightVO>' to 'System.Collections.Generic.List<ValueObjects.BaseVO>'
i.e
public class FlightVO : BaseVO
{
public int FlightId;
public string FlightName;
}
public class ScheduleVOMapper: BaseVOMapper<BaseVO>
{
public override void Insert(ValueObjects.BaseVO child, ValueObjects.BaseVO parent)
{
//((ScheduleVO)child).FlightList
this.SaveChildrens(((ScheduleVO)child).FlightList, parent);
}
public override void SaveChildrens(List<BaseVO> childListToPersist, BaseVO parentVO)
{
foreach (BaseVO child in childListToPersist)
{
ORlayerEngine.Persist(child, parentVO);
}
}
}
------------------------------------------------------------------Code using Generic at Method Level ------------------------------------------------------------------------------------------
Case 2
// generic type specified at method level , with the same constraint
public abstract class BaseVOMapper
{
public abstract void Insert(BaseVO child , BaseVO parent );
public abstract void SaveChildrens<T>(List<T> childListToPersist, BaseVO parentVO) where T:BaseVO ;
}
Below is the implementation of the derived class :
public class ScheduleVOMapper: BaseVOMapper
{
public override void Insert(ValueObjects.BaseVO child, ValueObjects.BaseVO parent)
{
//((ScheduleVO)child).FlightList
this.SaveChildrens(((ScheduleVO)child).FlightList, parent);
}
public override void SaveChildrens<T>(List<T> childListToPersist, BaseVO parentVO)
{
foreach (BaseVO child in childListToPersist)
{
ORlayerEngine.Persist(child, parentVO);
}
}
}
Comparing Case 1 & Case 2 , in case 1 , in the derived class ScheduleVOMapper , the SaveChildrens method has the generic type explicity specified as BaseVO ,
whereas in Case 2 , the method gets the Generic Type at runtime , which anyways as per the constraint has to be of Type BaseVO.
Though , I have my solution implemneted using Case 2 , would really like to get my doubt's cleared
Many Thanks
Girija
|
|
|
|
|
Why do you declare
girijaa wrote: public class ScheduleVOMapper: BaseVOMapper<basevo>
and not FlightVO instead of BaseVO as generic parameter?
I couldn't test it right now, just guessing.
Urs
-^-^-^-^-^-^-^-
no risk no funk
|
|
|
|
|
We’re struggling to register an unsafe assembly on a development server. The message given is:
CREATE ASSEMBLY for assembly 'Pastel.Evolution' failed because assembly 'Pastel.Evolution' is not authorized for PERMISSION_SET
Now I remember running a grant, “USE Master GRANT EXTERNAL ACCESS ASSEMBLY TO [SERVERNAME\User]” on my server, but the target server doesn’t use windows auth, and you can’t grant rights to ‘sa’. Any ideas on how we can allow ourselves to register an unsafe assmemly?
|
|
|
|
|
I need a help about this.
I've made a program to import csv files. Sometimes I caught this error message "must be less than or equal to max (-1)", I've been search at google and I found some messages saying about DataTable.Select(), something about that.
But I don't know why this error happens, if is the number of parameters or lenght of my csv files. The really problem is that error never happens at development time.
|
|
|
|
|
We have a website set up on our local computer for testing purposes and we then roll out the changes to our main server which is remotely accessed. I want to keep the two databases in sync by calling the dataadapter.update method twice passing in the same datatables (I happen to be using a typed dataset) and just changing the connection string for the remote database (I first wipe each database before the update). However, when I try to do this, after the local site database properly updates and I then call the update method again with a new connection string, the update does not work (it doesn't error, it just isn't working properly) and returns an integer value of 0 telling me that no new rows were updated (if I check the database I see nothing was written in.) I am trying to figure out what the issue is. I am guessing it has something do with the row.rowstate on the rows in the datatable telling the update method that these rows have already been written to the database, but if that is the case, is there any easy way to reset the rows so that update can be called again (I tried fooling with the row.setrowmodified but it didn't work and it gave me a concurrency exception)? For now, the workaround I am using is it to create a new dataset before any update is called, go through every row in the first dataset and write them to each table in the new dataset, and then call the update method passing in the tables of the new dataset. This does work, however it slows the program down considerably when building the new dataset. Anyone have any other ideas or suggestions?
modified on Wednesday, April 30, 2008 9:24 AM
|
|
|
|
|
Is it possible to force a TextBox to show it's input cursor even though it's not active?
|
|
|
|
|
Why would you like to do that?
Could you provide the exact requirement?
Regards,
Dave
Dave Traister
Software Engineer
ComponentOne LLC
www.ComponentOne.com
|
|
|
|
|
If I have a Select statement such as-
[ItemCost]*[ItemQuanity] as ItemSubtotal
How do I name the ItemSubtotal column in another select statement so I can-
[ItemSubtotal]-[AmountPaid] as BalanceDue
When I try this it does not know the ItemSubtotal as a valid column name since I created it in a as column name.
Thanks for the help......
|
|
|
|
|
You can't refer to columns by their alias until the ORDER BY clause because they haven't been serialized as the alias until then. So you have to define your two columns as:
SELECT (ItemCost * ItemQuantity) AS ItemSubtotal,
(ItemCost * ItemQuantity) - AmountPaid AS BalanceDue
If you're using SQL 2005, you could write a user defined function, call it subtotal and then use CROSS APPLY like this:
SELECT S.Subtotal AS ItemSubtotal,
S.Subtotal - ItemQuantity AS BalanceDue
FROM OrderDetails
CROSS APPLY dbo.GetSubTotal(ItemCost, ItemQuantity) S
But if your query isn't returning a large number of rows I really wouldn't worry about it and I would use the first method.
|
|
|
|
|
Mark,
Thanks for the help!
|
|
|
|
|
I have created an application using C# 2003
It runs well sometimes, and sometimes it gives the following error
"unable to find a version of the runtime to run this application"
Everytime this message appear, I have to rebuild my application
How to resolve this
Mohammed Gouda
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
And you didn't modify the machine.config file?
|
|
|
|
|
No
Where is that file?
Mohammed Gouda
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
I have a datagrid bound to a table in my database. I want one of the columns, which does not allow for nulls, to be filled with choices that I will supply beforehand. So I set up what was in this case the third column as a combobox and supplied it with my own list of values. Initially when the form loads, the values are displaying correctly (all rows have data in them) and I can select a value from the combobox, however, when I click off the row I keep getting an error saying datanonullallowedexception. All the rows appear to be filled. Is there a way for me to use the values that I am presupplying to be saved in that third field. (I know that a proper db schema would have parent-child tables for the column but for whatever reason I need to do it for the person this way.) The code I am using is simple for the the third column:
Me.DataGridViewTextBoxColumn3.DataSource = productsrows
Me.DataGridViewTextBoxColumn3.DisplayMember = "Product_SKU"
Any help is greatly appreciated.
|
|
|
|
|
Hi All,
My web application is taking too much time to release the page after it loads completly.
Scenario:
I have 9 views in a single page and some views have link with controls in other views. There is no problem with the page load/refresh, afetr it loads the progress bar stays still for some time ie., it doesnt release the page to the user.
Maximum users in the system would be 2600, but as per my perception it doesnt really hurt the application, since it loads quick but takes time to release the page(Struck). Today only 102 users logged into the system at peek time.
Please someone suggest how to tackle this issue.
Im using framework 2.0, SQL Server 2005 and IIS 6 in Windows 2003.
Thanks,
Bala
|
|
|
|
|
|
Hi everyone.
My customer has a COM object called validatecom.dll. I need to use this in my VS2005/C# web service. So I used tlbimp.exe to create a Runtime Callable Wrapper for validatecom.dll, defining the namespace as "wsl" because that makes sense in their environment. The COM interface is called IValidate, thus giving me a class called CValidateClass.
In my unit test, which runs as an ordinary .NET application, I can instantiate a wsl.CValidateClass object and call methods on it. No problem.
When I try to instantiate wsl.CValidateClass in my Web Service, however, I get an error, to wit:
System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID... yadda yadda yadda... failed due to the following error: 80070005.
And as we all know, 80070005 is another way of saying "Access Denied." Now I'm wondering why I can access the RCW assembly from an ordinary application, but not from a Web Service. I tried giving "full control" rights to "everyone" on that RCW assembly, but still no joy.
Any ideas on this? I'd be happy with a pointer to an MSDN article, a Google term, anything!
Thanks to all for your help.
|
|
|
|
|