Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

Paramu1973

@Paramu1973
About
Posts
227
Topics
118
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Convert From C# to C++/CLI
    P Paramu1973

    Hi, I try to convert from C# to C++/Cli. I have a small application in C#. When I try to print the RDLC report directly to printer, I found a c# online-codes.

        public static void Print(this LocalReport report, PageSettings pageSettings)
        {
            string deviceInfo =
                $@"
                    EMF
                    {pageSettings.PaperSize.Width \* 100}in
                    {pageSettings.PaperSize.Height \* 100}in
                    {pageSettings.Margins.Top \* 100}in
                    {pageSettings.Margins.Left \* 100}in
                    {pageSettings.Margins.Right \* 100}in
                    {pageSettings.Margins.Bottom \* 100}in
                ";
            Warning\[\] warnings;
            var streams = new List();
            var pageIndex = 0;
            report.Render("Image", deviceInfo,
                (name, fileNameExtension, encoding, mimeType, willSeek) =>
                {
                    MemoryStream stream = new MemoryStream();
                    streams.Add(stream);
                    return stream;
                }, out warnings);
            foreach (Stream stream in streams)
                stream.Position = 0;
            if (streams == null || streams.Count == 0)
                throw new Exception("No stream to print.");
            using (PrintDocument printDocument = new PrintDocument())
            {
                printDocument.DefaultPageSettings = pageSettings;
                if (!printDocument.PrinterSettings.IsValid)
                    throw new Exception("Can't find the default printer.");
                else
                {
                    printDocument.PrintPage += (sender, e) =>
                    {
                        Metafile pageImage = new Metafile(streams\[pageIndex\]);
                        Rectangle adjustedRect = new Rectangle(e.PageBounds.Left - (int)e.PageSettings.HardMarginX, e.PageBounds.Top - (int)e.PageSettings.HardMarginY, e.PageBounds.Width, e.PageBounds.Height);
                        e.Graphics.FillRectangle(Brushes.White, adjustedRect);
                        e.Graphics.DrawImage(pageImage, adjustedRect);
                        pageIndex++;
                        e.HasMorePages = (pageIndex < streams.Count);
                        e.Graphics
    
    Managed C++/CLI csharp c++ graphics

  • How To Print direct from the RDLC Report to the default Printer?
    P Paramu1973

    Hi, Iam using VS2015. I wish to print the RDLC Report to the default printer ? Is it possible? Any advice to learn this? Thank

    Managed C++/CLI tutorial question

  • How to close & clear the oledbconnection on form2()_load?
    P Paramu1973

    Hi, I am using vs-2015. Managed C++/Cli Windows Forms Applications. I have Form1-MdiContainer & Form2. From Form1_Button_Click() accessing Form2. In Form2_Load() I have OLEDBConnection. For When I press Form1-Button_Click(), First time it's working good. Also when I re-click() the same Form1-Button() the whole application is getting closed. I analysed that when I close the OLEDBConnection, the whole program is also getting closed. And the same code working good in c#. I can't understand my mistakes..! Thanks. Note:- For First time when I click the Form1-Button no problem it's working good. But for re-click() whole application is getting closed(). Thanks Again My Codes

    Form1-MdiContainer()
    private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
    Form2^ MyStForm = Form2::GetForm(true, this);
    MyStForm->MdiParent = this;
    MyStForm->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
    MyStForm->Dock = DockStyle::Fill;
    MyStForm->Show();
    }
    Form2-Top side
    public ref class Form2 : public System::Windows::Forms::Form
    {
    public: static Form2^ Form2::_instance = nullptr;
    public: static Form2^ Form2::GetForm(bool IsMDIChild, System::Windows::Forms::Form^ MyInstFrm) {
    if (_instance == nullptr)
    _instance = gcnew Form2();
    if (_instance->IsDisposed)
    _instance = gcnew Form2();
    if (IsMDIChild)
    _instance->MdiParent = MyInstFrm;
    return _instance;
    }
    blah..blah...blah...
    }

    Form2-Load()
    private: System::Void Form2_Load(System::Object^ sender, System::EventArgs^ e) {
    String^ MyStrConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + MyExcelFile + "; Extended Properties=\"Excel 12.0; HDR=YES; OLE DB Services=-1; \"";
    String^ MyExcelFile="C:\\Students\\Names.xlsx";
    String^ MyExcelSheet = "[Sheet1$]";
    String^ MySQLSelect = "select * from " + MyExcelSheet;
    System::Data::OleDb::OleDbConnection^ Cn1 = nullptr;
    Cn1 = gcnew System::Data::OleDb::OleDbConnection();
    Cn1->ConnectionString = MyStrConn;
    System::Data::OleDb::OleDbCommand^ MyCmd = nullptr;
    MyCmd = gcnew System::Data::OleDb::OleDbCommand();
    MyCmd->CommandText = MySQLSelect;
    MyCmd->Connection = Cn1;
    Cn1->Open();
    System::Data::OleDb::OleDbDataAdapter^ Da1 = gcnew System::Data::OleDb::OleDbDataAdapter(MyCmd);
    Da1->Fill(MyDataTable);
    Cn1->Close(); //????????????????? getting stuck
    if (Cn1 != nullptr){
    MyCmd->Cancel();
    }
    //Cn1->ConnectionString = nullptr;
    //Cn1->ReleaseObjectPool();
    MyCmd = nullptr;
    Cn1 = nullptr

    Managed C++/CLI help csharp c++ database visual-studio

  • Convert From C# To Visual C++ 2015
    P Paramu1973

    Thank Richard

    Managed C++/CLI c++ sales csharp xml

  • Convert From C# To Visual C++ 2015
    P Paramu1973

    hi Richard Deeming, Sorry & Thank for the advise and the reason is Visual C++/CLR doesn't support LINQ. I do remember all your advises are powerful & good. Your replies helped many times while I get struck. Thank Again ! :rose:

    Managed C++/CLI c++ sales csharp xml

  • Convert From C# To Visual C++ 2015
    P Paramu1973

    Hi, I need to generate the following XML codes. And Iam using VS2015.

     Sales
     No
        Yes
        No
        Customer 1
        \-5000
    

    For That from our website quick answers, I received the following codes in C#.

    [XmlRoot(ElementName="ALLLEDGERENTRIES.LIST")]
    public class ALLLEDGERENTRIESLIST {

    \[XmlElement(ElementName="REMOVEZEROENTRIES")\] 
    public string REMOVEZEROENTRIES { get; set; } 
    
    \[XmlElement(ElementName="ISDEEMEDPOSITIVE")\] 
    public string ISDEEMEDPOSITIVE { get; set; } 
    
    \[XmlElement(ElementName="LEDGERFROMITEM")\] 
    public string LEDGERFROMITEM { get; set; } 
    
    \[XmlElement(ElementName="LEDGERNAME")\] 
    public string LEDGERNAME { get; set; } 
    
    \[XmlElement(ElementName="AMOUNT")\] 
    public int AMOUNT { get; set; } 
    

    }

    [XmlRoot(ElementName="VOUCHER")]
    public class VOUCHER {

    \[XmlElement(ElementName="VOUCHERTYPENAME")\] 
    public string VOUCHERTYPENAME { get; set; } 
    
    \[XmlElement(ElementName="ALLLEDGERENTRIES.LIST")\] 
    public ALLLEDGERENTRIESLIST ALLLEDGERENTRIESLIST { get; set; } 
    
    \[XmlAttribute(AttributeName="VCHTYPE")\] 
    public string VCHTYPE { get; set; } 
    
    \[XmlAttribute(AttributeName="ACTION")\] 
    public string ACTION { get; set; } 
    
    \[XmlText\] 
    public string Text { get; set; } 
    

    }

    [XmlRoot(ElementName="TALLYMESSAGE")]
    public class TALLYMESSAGE {

    \[XmlElement(ElementName="VOUCHER")\] 
    public VOUCHER VOUCHER { get; set; } 
    
    \[XmlAttribute(AttributeName="UDF")\] 
    public string UDF { get; set; } 
    
    \[XmlText\] 
    public string Text { get; set; } 
    

    }

    Is It possible to convert this From C# to Visual C++ 2015. My heartiest thanks for all helps Always Thank To Richard & Victor & Other Superiors, those who are having kind hearts. Thank Again

    Managed C++/CLI c++ sales csharp xml

  • openFileDialog - AccessViolationException was unhandled
    P Paramu1973

    Thank Victor:rose::thumbsup:

    Managed C++/CLI performance help

  • openFileDialog - AccessViolationException was unhandled
    P Paramu1973

    Hi, Iam using Vs2015, While I try to Open a file using OpenFileDialog, Iam receiving the error "Unhandled exception of type" System.AccessViolationException" occoured in system.windows.forms.dll Additional information: Attempted to read or write protected memory.This is often an indication other memory is currupt. My Codes

    System::Windows::Forms::OpenFileDialog^ MyFileOpenDialog = gcnew System::Windows::Forms::OpenFileDialog();
    MyFileOpenDialog->Title = "Select Your Excel Test File";
    MyFileOpenDialog->InitialDirectory = "C:\\";
    MyFileOpenDialog->Filter = "Excel Files (*.xls)|*.xls|All files (*.*)|*.*";
    MyFileOpenDialog->FilterIndex = 2;
    MyFileOpenDialog->RestoreDirectory = true;
    if (MyFileOpenDialog->ShowDialog() == System::Windows::Forms::DialogResult::OK) {
    MyExcelFile = MyFileOpenDialog->FileName;
    }

    I cannot understand my mistake ! Thanks For the helps!:thumbsup: Richard pls. advise me! Thank again !

    Managed C++/CLI performance help

  • How to install Visual Studio Android Emulator in Windows 10 Home
    P Paramu1973

    Thank Richard.

    Mobile csharp android visual-studio help tutorial

  • How to install Visual Studio Android Emulator in Windows 10 Home
    P Paramu1973

    Hi, I am using VS2015, Windows-10 Home. When I try to install, Visual Studio Android Emulator, it asked me to install Hyper-V, and then I installed. But now Iam receiving the message like Visual Studio Android Emulator can not installed in Windows 10 Home. Is there any solution. Thanks

    Mobile csharp android visual-studio tutorial

  • How to install Visual Studio Android Emulator in Windows 10 Home
    P Paramu1973

    Hi, Iam using VS2015, Windows-10 Home. When I try to install Visual Studio Android Emulator in Windows 10 Home, It asked me to install Hyper-V. Then I installed. But now Iam getting the error message

    Visual Studio Android Emulator can not install in Windows 10 Home

    Thanks

    Mobile csharp android visual-studio help tutorial

  • More Than One Operator "+" Matches These Operands
    P Paramu1973

    It's ok Richard, Thank Again for reply The following code clears my error()

    textBox10->Text = Convert::ToString(Decimal::Add(Decimal::Add(DJSubTot, DJVATTot), DJFreightTot));

    Managed C++/CLI c++ help

  • More Than One Operator "+" Matches These Operands
    P Paramu1973

    Thank Richard

    textBox10->Text = (DJSubTot + DJVATTot + DJFreightTot).ToString();

    The above line Thank Again

    Managed C++/CLI c++ help

  • More Than One Operator "+" Matches These Operands
    P Paramu1973

    Hi, I have a small project in vc++ 2015. While I calculate the total, I get this error. Is it possible to solve this error. Any Kind helps.

    private: static System::Decimal MyNumber2;
    private: static System::Decimal DJSubTot = 0;
    private: static System::Decimal DJVATTot = 0;
    private: static System::Decimal DJFreightTot = 0;

    MyNumber2 = 0;
    if(Decimal::TryParse(textBox8->Text->Trim(), MyNumber2)){
    DJVATTot = MyNumber2;
    }
    MyNumber2 = 0;
    if (Decimal::TryParse(textBox9->Text->Trim(), MyNumber2)) {
    if (MyNumber2>0) {
    DJFreightTot = MyNumber2;
    }
    }
    textBox10->Text = (DJSubTot + DJVATTot + DJFreightTot).ToString();

    Thanks for the helps

    Managed C++/CLI c++ help

  • How to access the ref class declared DataTable ?
    P Paramu1973

    Thank Richard

    Managed C++/CLI c++ visual-studio winforms design help

  • How to access the ref class declared DataTable ?
    P Paramu1973

    Thank Richard, I checked by Without static declaration, but still the error raised. I assume that, we have to supply the datatype to that for loop variable [W1].[May be Not sure]

    String^ ICode=String::Empty;
    for(int W1=0; W1<=UnitRateTbl->Rows->Count-1; W1++){
    ICode=UnitRateTbl->Rows[W1]["itm_code"]->ToString(); ??????????????
    }

    Thanks Again

    Managed C++/CLI c++ visual-studio winforms design help

  • How to access the ref class declared DataTable ?
    P Paramu1973

    Hi, I have a small project in VS2010 and its working fine. Now I am trying to upgrade to VS 2015 & Found Visual C++ by using creating project C++/Cli->UI->Windows Forms Applications. I get struck in following simple codes, I cannot identify my mistake.

    public ref class My_ProjectData
    {
    public:
    static System::Data::DataTable^ UnitRateTbl = gcnew System::Data::DataTable();

    public: static void MyUnitRate_Collect() {
    String^ ICode=String::Empty;
    for(int W1=0; W1<=UnitRateTbl->Rows->Count-1; W1++){
    ICode=UnitRateTbl->Rows[W1]["itm_code"]->ToString(); // Error on this line UitRateTbl
    }
    };
    Error : function "System::Data::DataRowCollection::default[int]::get" cannot be called with the given argument list

    Thanks for the helps

    Managed C++/CLI c++ visual-studio winforms design help

  • Convert From C# VS2010 - get_Item & set_Value in C++/CLI
    P Paramu1973

    Hi, I wish to convert from c# for the following codes contain get_Item & set_Value convertion in C++/Cli.

    Code:
    private static void SetWIAProperty(IProperties properties, object propName, object propValue)
    {
    Property prop = properties.get_Item(ref propName);
    prop.set_Value(ref propValue);
    }

    Any guidences will be helpful. Thanks Again

    Managed C++/CLI csharp c++

  • FileStream.Write Only particular pages of Report as PDF?
    P Paramu1973

    Hi Iam using VS-2010. Windows Applications. The below codes to save the report as PDF in c#...But I wish to save the particular part of report as PDF... Note: Suppose My report contains 4-Copies with 8 pages, my intention is to save only the "Transporter Copy" as mentioned in Report Header area. Is it possible to save only the particular copy of reportviewer's report...? Thanks:thumbsup: My Codes

    byte[] Bytes = Reportviewer1.LocalReport.Render(format:"PDF",deviceInfo:"");
    using (FileStream stream = new FileStream("C:\MyFolder", FileMode.Create))
    {
    stream.Write(Bytes, 0, Bytes.Length);
    }

    C# csharp visual-studio question

  • Convert From c# - For Report Viewer Report save as PDF format
    P Paramu1973

    THANKS:thumbsup:

    Managed C++/CLI csharp c++
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups