can you provide a code snippet
Radhakrishnan G
Posts
-
I nead to pass an Interface from the C++ wrapper into a C# class -
How to convert SAFEARRAY to System::Object -
I nead to pass an Interface from the C++ wrapper into a C# classYou can use a C++/CLI wrapper instead of C++ wrapper so that C++/CLI wrapper can use directly in C#
-
KnownTypeAttribute in C++.NET;
[DataContract]
[KnownType(List<String^>::typeid)]
ref class MyClass
{
public List<String^>^ _myStrings;
};[DataContract]
[KnownType(List<MyClass^>::typeid)]
ref class NewClass
{
[DataMember]
public List<MyClass^>^ _myClasses;
};this data contact is failed in WCF serialization Anyone know about this problem?? Thanks
-
TIL...... [modified]what is that
"n"
it is 1 for p = 5?? -
Goal finding: I just need the name of an algorithmHi You can represent this as a Graph-problem(some kind of shortest path algorithm) You can apply these restrictions while moving 1 . Trace your current path, if the new slot is in the current path ignore that to avoid a loop 2 . Mark the positions in which no further movements are possible so that we can ignore that. 3 . If we have no further move retract your move using a stack Back-tracking may not be an optimal solution, but you can apply some restrictions to improve it Thanks
-
Find an algorithmprivate void Logic( bool f1, bol f2, bool f3, bool f4, bool f5, bool f6, bool expected)
{
bool result = ((!f1) && (!f2) && f5 && f6 && ( ((!f3) && (!f4)) || ( f3 && f4 )));
System.Diagnostics.Debug.Assert( result == expected, "Does not match expected results" );
} -
List<^>^ c++ [modified]ref class Field
{
public:
String^ name;
int numBits;
String^ description;
};ref class Message
{
public:
// Other members
List<Field^>^ fields;
};ref class TeleCommand
{
public:
// other members
List<Message^>^ messages;
};// then your list of commands
List<TeleCommand^>^ teleCommands;I think this kind of datastructure will solve your issue, also these are handles to the reference, so you can add more items using the Add method like
teleCommands->messages->Add( gcnew Message())
Thanks Radhakrishnan G.modified on Wednesday, November 3, 2010 12:13 AM
-
COM Servers exe in .NET [modified]Thanks I need to implement the COM Server as exe and it should support automation interfaces
-
Using VC6 MFC DLLs in VS2008I am using an old dll which is written in VC6 MFC( Builded with mfc42u.lib), I need to reuse the same in my C++/CLI application which is in VS2008( it use mf90u.lib) while copying a string buufer to that old dll it cause an exception like "try to read/writing in protected meory"
// Class in old dll
String^ csMyString = gcnew String( "some value" );
MyClass* fromOldDll = new MyClass();
fromOldDll->m_csSomeString = static_cast(Marshal::StringToHGlobalUni(csMyString).ToPointer());
// Above line cause exceptionIs any other idea for implementing the same, it is not possible to modify the old dll Thanks Radhakrishnan G.
-
COM Servers exe in .NET [modified]Is it possible to create a COM server exe in .NET All samples available are creating a class library So we can develop a COM Server as exe in .NET?
modified on Tuesday, November 2, 2010 11:26 AM
-
"Best Fit" Algorithm Request && Teach A Man To FishYes, I agree with you
-
find a sulution!Subset Sum problem I am pasting an algorithm, got this from a book
Algorithm SumOfSubSet(s,k,r)
// Find all subset of w[1:n] that sum to m. The values of x[j],
// 1 <j<k, have already been determined. s = w[1]*x[1] + ... + w[k-1]*x[k-1]
// and r = w[k] + .. + w[n]. The w[j] are in non decreasing order
// It is assumed that w[1]< m and sum of w[i] > m where i = 1..n
{
x[k] := 1;
if( s + w[k] = m ) then Write( x[1:k]); // Subset found
else if( s + w[k] + w[k+1] <= m )
then SumOfSub( s + w[k], k+1, r-w[k]);
if( (s+r-w[k] >= m) and (s + w[k+1] <= m )) then
{
x[k] := 0;
SumOfSub( s, k + 1, r - w[k]);
}
}s
= is the sum to be generatedw
is the set with sizen
,x
is an array and ifx[i]
is one meansi
th element inw
is in the subsetk
is the index of element inw
we are examining r is the remaining sum that can be created fromk +1
th element ton
th item inw
modified on Thursday, May 12, 2011 9:23 AM
-
How to find the average, worst complexity of a codeYes it is the order of n O(n)
-
How to find the average, worst complexity of a codeYou have to claculate from your program; for this example first for loop execute "n" times and second loo execute n times because value of "i" is "n" suppose "T1" time need to execute one iteration in the first for loop and "T2" time needs for one iteration in second loop so it take T1*n + T2*n that is an order of n, ie it depend on input variable "n" This is the time complexity
-
Toobar and menubar appearance in .Net ApplicationsDear All How can i create menu or toolbar in windows native look in .net Usually its look different from normal menu and toolbar of windows also how to use rebars in .net:confused: Thanks and Regrads Radhakrishnan G.
-
CListCtrl::OnTimer()Yes, Its working Actually I made a mistake.. Thanks Please find my 5 Votes.
-
CListCtrl::OnTimer()Hi all, I have a customized ListCtrl, and Called SetTimer() but OnTimer() handler will execute only once.. And I does not called any KillTimer(), My OnTimer is Like this
void ListCtrlEx::OnTimer( UINT nIDEvent_i ) { if( 100 == nIDEvent_i ) { // Do some thing } CListCtrl::OnTimer( nIDEvent_i ); } // My set timer is in MouseMove // If mouse butto is pressed SetTimer( 100, 300, 0 );
Any possible reason for the same Regards, Radhakrishnan G. -
Ftp Directory and Webserver director in Same FolderI have an FTP server configured to a directory that is inside the webserver root Some times acessing files is not allowed Any problem in doing the same
-
Writing Application configurationNeed to update application configuration
private void UpdateAppSettings( string settingName, string settingValue)
{
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
AppSettingsSection appSettings = config.AppSettings;
KeyValueConfigurationElement setting = appSettings.Settings[settingName];
setting.Value = settingValue;
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");
}Not able to build the application error showing thet Configuration is not there in System.Configuration namespace