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
M

Member 12244972

@Member 12244972
About
Posts
19
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • No overload for method 'PassStructIn' takes 4 arguments
    M Member 12244972

    The line of code...

    Quaternion quat = new Quaternion ((double)absW, (double)absX, (double)absY, (double)absZ);

    Brings up the following error.

    'Siren.Program.Quaternion' does not contain a constructor that takes 4 arguments

    Any other ideas?

    C# help tutorial question

  • No overload for method 'PassStructIn' takes 4 arguments
    M Member 12244972

    Perhaps showing the code for the dll will help...

    using System;
    using System.Collections.Generic;
    using System.Text;

    namespace YLScsDrawing.Drawing3d
    {
    public struct Quaternion
    {
    public double X, Y, Z, W;

        public Quaternion(double w, double x, double y, double z)// This is the set of parameters I wish to call...
        {
            W = w; X = x; Y = y; Z = z;
        }
     }
    

    }

    Any suggestions?

    C# help tutorial question

  • No overload for method 'PassStructIn' takes 4 arguments
    M Member 12244972

    And in my usual fashion of cobbling together source codes before I have grasped the concepts, I give you this glorious error:

    No overload for method 'PassStructIn' takes 4 arguments

    The code in question happens to be a call to an unmanaged dll:

    class Program
    {
    public struct Quaternion
    {
    double w; double x; double y; double z;
    }

      \[DllImport("YLScsDrawing.dll")\]
      public static extern void PassStructIn(ref Quaternion myQuaternion);
    
        static void Main(string\[\] args)
        {
        Program.Quaternion myQuaternion;
        Program.PassStructIn(ref myQuaternion);
    
        //Yada Yada Yada
    
        //Then the threading of said function...
    
        // Abs threads
        Thread absoluteThread = new Thread(unused => Program.PassStructIn((double)absW, (double)absX, (double)absY, (double)absZ));
        absoluteThread.Start();
      	// Abs threads
    

    Please advise on how to fix this... Thanks.

    C# help tutorial question

  • The type or namespace name 'Form' could not be found (are you missing a using directive or an assembly reference?)
    M Member 12244972

    I'm being impatient because I expected to be done with this today. But since that is not going to happen, I'll stop cobbling things together and recode with fresh eyes tomorrow. Thanks for the help. Will get back to you.

    C#

  • The type or namespace name 'Form' could not be found (are you missing a using directive or an assembly reference?)
    M Member 12244972

    Ok, created a new project for Windows form. The recurring error now is:

    Invalid token '(' in class, struct, or interface member declaration

    In the code:

    namespace Siren
    {
    static class Program
    {
    public partial class Form1 : Form
    {
    IDictionary _libs = new Dictionary();

        // yada yada yada...
    
    	int absW, absX, absY, absZ;
                
        // Your inputs here
        Console.Write("\\nPlease input parameter 1 of first set... ");// Error occurs here...
        absW = Console.ReadLine();
     }
    

    }
    static void Main()
    {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new Form1());
    }
    }

    C#

  • The type or namespace name 'Form' could not be found (are you missing a using directive or an assembly reference?)
    M Member 12244972

    Ok, I understand your point. The dll was targetting .net v2.0 and the program .net v4.6.1 I rebuilt the dll targetting .net v4.6.1 Still the same issue after restarting the Visual studio.

    The type 'System.ComponentModel.IComponent' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    The type 'System.ComponentModel.ISynchronizeInvoke' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    The type 'System.ComponentModel.Component' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    Any ideas?

    C#

  • The type or namespace name 'Form' could not be found (are you missing a using directive or an assembly reference?)
    M Member 12244972

    Ok, that fixed that... Now the errors are:

    The type 'System.ComponentModel.IComponent' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    The type 'System.ComponentModel.ISynchronizeInvoke' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    The type 'System.ComponentModel.Component' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    Only thing is I'm using Visual studio 2012 ultimate. I can't seem to find the assemblies in: Project > Add Reference > Framework Any ideas?

    C#

  • The type or namespace name 'Form' could not be found (are you missing a using directive or an assembly reference?)
    M Member 12244972

    Hi, I'm coding a C# program to include a dll I previously compiled but I keep getting the error:

    The type or namespace name 'Form' could not be found (are you missing a using directive or an assembly reference?)

    The code is:

    using System;
    using System.Threading;
    using System.Collections.Generic;
    using System.Reflection;
    using System.IO;

    namespace Threshold
    {
    public partial class Form1 : Form
    {
    IDictionary<string, Assembly> _libs = new Dictionary<string, Assembly>();

    	public Form1()
    	{
    		AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain\_AssemblyResolve);
    		InitializeComponent();
    	}
    

    // yada yada yada...
    }

    I am probably just making a rookie mistake. Please advise. Thanks

    C#

  • The name 'Beeper' does not exist in the current context
    M Member 12244972

    Ok, removed the

    ThreadStart(/*stuff*/); //Business...

    and implemented a lambda...

    Thread childThreadW = new Thread(unused => cacophony.Beeper((int)nw, Duration, 16383));

    and my code builds fine now. Thank you all!

    C#

  • The name 'Beeper' does not exist in the current context
    M Member 12244972

    Ok, but as you may see. The Beeper(); Function inputs 3 parameters (frequency, Duration and volume). The

    ThreadStart(cacophony.Beeper);

    does not pass these parameters or am I missing something?

    C#

  • The name 'Beeper' does not exist in the current context
    M Member 12244972

    This exact line of code is where the error occurs:

      //Generate frequency for nw
      ThreadStart Wfrequency = new ThreadStart(cacophony.Beeper((int)nw, Duration, 16383));
      //Generate frequency for nw
    

    Specifically the ThreadStart() function. The error is:

    Method name expected.

    C#

  • The name 'Beeper' does not exist in the current context
    M Member 12244972

    Sorry, but please walk me through it. The example and my code look identical to me.

    C#

  • The name 'Beeper' does not exist in the current context
    M Member 12244972

    Ok, now the error is:

    Method name expected.

    Any ideas?

    C#

  • The name 'Beeper' does not exist in the current context
    M Member 12244972

    Hi, I am coding two .cs files into one dll but Visual Studio 2012 sends the following error message:

    The name 'Beeper' does not exist in the current context.

    The first file codes like this:

    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Threading;
    using System.Windows.Forms;
    namespace Hum
    {
    public class Singer
    {
    public void Beeper(long frequency, int msDuration, long volume)
    {
    //Stream a tone of specified frequency...
    }
    }
    }

    When I do the function call in the second .cs file:

    Singer cacophony = new Singer();
    int Duration = 300000;
    //Generate frequency for nw
    ThreadStart Wfrequency = new ThreadStart(Beeper(nw, Duration, 16383));
    Thread childThreadW = new Thread(Wfrequency);
    childThreadW.Start();
    //Generate frequency for nw

    It gives the error. I know I am missing something very basic. Thanks for the help.

    C#

  • Compile dll in Ubuntu to include in Windows 7 (32 bit) program
    M Member 12244972

    Hi, I just need instructions to build my working source code in C++ into a dll that is compatible with Windows 7. Thanks.

    C / C++ / MFC

  • std::string declaration in header file error
    M Member 12244972

    I was making the wrong function call.

    v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

    should have been

    execute_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

    Problem fixed. Thanks all.

    C / C++ / MFC

  • std::string declaration in header file error
    M Member 12244972

    I was making the wrong function call.

    v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

    should have been

    execute_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

    Problem fixed. Thanks all.

    C / C++ / MFC

  • std::string declaration in header file error
    M Member 12244972

    Hi, I need your help a bit in C++. I am coding a dll but my source code has 2 errors. Both issues stem from the same declaration in my header file.

    void execute_assert(bool expr, std::string str);

    When I do the function calls...

    v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");

    and

    v_assert(s < 1, "Illegal acl size (" + deb + ")");

    I get the error message...

    Error: too many arguments to function ‘void execute_assert(bool, std::string)’

    On both counts, the parameter count is ok, so what's the problem? Please help.

    C / C++ / MFC

  • Probability
    M Member 12244972

    Hi, I am learning probability and need a good working algorithm for selecting between two options successfully. Any help will be appreciated. Please post the algorithm in equation form. Thanks.

    Algorithms algorithms help learning
  • Login

  • Don't have an account? Register

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