Search Results

Search found 4717 results on 189 pages for 'namespace'.

Page 103/189 | < Previous Page | 99 100 101 102 103 104 105 106 107 108 109 110  | Next Page >

  • C++ Char without Limit

    - by Lienau
    I'm pretty well versed in C#, but I decided it would be a good idea to learn C++ as well. The only thing I can't figure out is chars. I know you can use the string lib but I also want to figure out chars. I know you can set a char with a limit like this: #include <iostream> using namespace std; int main() { char c[128] = "limited to 128"; cout << c << endl; system("pause"); return 0; } But how would I make a char without a limit? I've seen chars with * but I though that was for pointers. Any help is greatly appreciated.

    Read the article

  • NUnit [Test] is not a valid attribute

    - by tyndall
    I've included the necessary assemblies into a Windows Class project in VS2008. When I start to try to write a test I get a red squiggle line and the message [Test] is not a valid attribute. I've used NUnit before... maybe an earlier version. What am I doing wrong? I'm on version 2.5.2. using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit; using NUnit.Core; using NUnit.Framework; namespace AccessPoint.Web.Test { public class LoginTests { [Test] public void CanLogin() { } } }

    Read the article

  • Html.ActionLink in a button

    - by Pomster
    I Am trying to connect to a method in my controller, with a button. I can connect though this link: @Html.ActionLink("Print", "Print", new { id = Model.SalesContractId}) But i Don't want a link, i want my button on my dialog to do it. I have tried the following: $('#btnDialogPrint').click(function () { location.href = '<%= Url.Action("Print", "Print", new { id = Model.SalesContractId}) %>'; }); But it just redirect me to a page that say bad request. namespace Contract.Controllers { public class ContractController : Controller { CompassEntities db = new CompassEntities(); public ActionResult Print(int id) { return View(""); // This can be removed and Print code may be added } Don't worry about the code inside i will get to that once i get inside this method. Could i maybe attach a link here? <input type="button" value="Print" id="btnDialogPrint" />

    Read the article

  • Referencing a different project in the same assembly, different namespaces

    - by Redburn
    I have two projects : Menu and Module and they are both in the same namespace foobar. I am currently referencing the module project from the Menu project to open up certain controls on a tab control in my menu. However I need to launch a new control from one of my controls which is located in the Module project. When I try referencing the menu project, it does not show up in my intellisense when I try to reference it with a using. Am I doing something wrong logically here? Here is an example of what it is : Project Menu Public Void LaunchWPFControl(string pHeader,string pPath) { //Code goes here to launch a WPF control in the browser } Project Module //What I would love to do but doesn't work Using Menu; ... ... ... private void dgModule_MouseDoubleClick(object sender, MouseButtonEventArgs e) { Menu.LaunchWPFControl("Accounts","AccountsControl"); }

    Read the article

  • Trying to create C++/CLI assembly for use in .NET

    - by Bad Man
    I'm trying to bring a C++ library into C#, so naturally I am trying to make a C++/CLI project. In visual studio I created a new project (Visual C++ project, class library). I then tried to make a test class out of the pre-generated "Class1" namespace Test { public ref class TestIt { public: void DoWork() { System::Console::WriteLine("sup"); } // TODO: Add your methods for this class here. }; } So I compile in and go to the build folder.... hrmm no .dll wetf?? There's a .dll.intermediate.manifest file, but no .dll. So wut I did wrong?

    Read the article

  • How To Parse String File Txt Into Array With C++

    - by Ibnu Syuhada
    I am trying to write a C++ program, but I am not familiar with C++. I have a .txt file, which contains values as follows: 0 0.0146484 0.0292969 0.0439453 0.0585938 0.0732422 0.0878906 What I have done in my C++ code is as follows: #include <iostream> #include <fstream> using namespace std; int main() { string line; ifstream myReadFile; myReadFile.open("Qi.txt"); if(myReadFile.is_open()) { while(myReadFile.good()) { getline(myReadFile,line); cout << line << endl; } myReadFile.close(); } return 0; } I would like to make the output of the program an array, i.e. line[0] = 0 line[1] = 0.0146484 line[2] = 0.0292969 line[3] = 0.0439453 line[4] = 0.0585938 line[5] = 0.0732422 line[6] = 0.0878906

    Read the article

  • Unable to make WMI connection from XP Pro machine to another (not in domain, same workgroup) in C#

    - by JCCyC
    I have two XP Pro SP3 machines. I disabled the firewall in both. The workgroup name is WORKGROUP. I have an administrator account with identical username/password in both. My code to connect is the following: ConnectionOptions options = new ConnectionOptions(); options.Username = myUsername; options.Password = myPassword; options.Authority = "ntdlmdomain:WORKGROUP"; // Commenting this or not makes no difference ManagementScope scope = new ManagementScope(String.Format("\\\\{0}\\{1}", hostname, Namespace), options); scope.Connect(); I always get a System.UnauthorizedAccessException with the text: "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" The above code works between two machines that are part of the same AD domain. What am I doing wrong?

    Read the article

  • use class in another windows form c# ???

    - by Chelsea_cole
    I have a problem in a same namespace: public partial class frmForm1 : Form // Form1 { public class Account { public string Username; public string Password; public string RePassword; public string Name; public string bd; public string dt; public string dc; } public class ListAcc { public static int count = 0; private static List<Account> UserList; public static List<Account> Data() { return UserList; } } } public partial class frmForm2 : Form // Form2 { private void button2_Click(object sender, EventArgs e) { ListAcc A; // error string n = A<Account>[0].Usename; // error // What should i do? } } Someone can help me fix this problem? Thanks alot!

    Read the article

  • Error : The Type Initializer of Daemon.Global threw an exception in c#

    - by srk
    I am using the below class file, where some variables are declared to use in the entire application. Now I used that variable BlockLogOut in another class file to make the value true. I just put this below line and getting error in it.. TypeInitializationException Global.BlockLogOut = True; The weird thing is, it was working fine for many months and i am getting this error now on the above line. Of course i was modifying some other stuffs in the application, but surely not this class file. What would have been the problem? namespace Daemon { class Global { public static bool BlockLogOut = false; } }

    Read the article

  • assembly.GetTypes() does not return all types

    - by meta
    I try to lead the types from an .dll (which is also referenced in the executing project). I call: public static void LoadPlugin(string pluginFile) { Assembly assembly = Assembly.LoadFrom(pluginFile); foreach (Type type in assembly.GetTypes()) { // play with it } } It loads just a few of them: public partial class Mathematics : UserControl, IMathematics, IPortable and public partial class Welcome : UserControl but the next one, and some others, are ignored: public partial class Test : UserControl, ITest, IPortable They all stand in the same assembly, under the same namespace. The public static void LoadPlugin(string pluginFile) method is located in other assembly that is also referenced in the executing project. No exceptions are thrown. What could be the issues for not loading all the types? Any ideas?

    Read the article

  • how to use replace_regex_copy() from boost::algorithm library?

    - by Vincenzo
    This is my code: #include <string> #include <boost/algorithm/string/regex.hpp> string f(const string& s) { using namespace boost::algorithm; return replace_regex_copy(s, "\\w", "?"); } This is what compiler says: no matching function for call to ‘replace_regex_copy(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::string, std::string) The link to the library: http://www.boost.org/doc/libs/1_43_0/doc/html/boost/algorithm/replace_regex_copy.html Could anyone please help? Thanks! ps. Boost library is in place, since other functions from it work fine.

    Read the article

  • Switch/Case statements in C++

    - by vgoklani
    Regarding the switch/case statement in the C++ code below: "Case 1" is obviously false, so how/why does it enter the do-while loop? #include <iostream> using namespace std; int main() { int test = 4; switch(test) { case 1: do { case 2: test++; case 3: test++; case 4: cout << "How did I get inside the do-while loop?" << endl; break; case 5: test++; } while(test > 0); cout << test << endl; } }

    Read the article

  • Shuffle array variables in a pre-specified order, without using extra memory of "size of input array"

    - by Eternal Learner
    Input : A[4] = {0,4,-1,1000} - Actual Array P[4] = {1,0,3,2} - Order to be reshuffled Output: A[4] = {4,0,1000,-1} Condition : Don't use an additional array as memory. Can use an extra variable or two. Problem : I have the below program in C++, but this fails for certain inputs of array P. #include<iostream> using namespace std; void swap(int *a_r,int *r) { int temp = *r; *r = *a_r; *a_r = temp; } int main() { int A[4] = {0,4,-1,1000}; int P[4] = {3,0,1,2}; int value = A[0] , dest = P[0]; for(int i=0; i<4;i++) { swap(&A[dest],&value); dest = P[dest]; } for(int i=0;i<4;i++) cout<<A[i]<<" "; }

    Read the article

  • Normal C++ code in Qt doesnt build and run

    - by Nick
    Hello. I am using Qt under linux, if it matters. I ran successfully under Geany (a simple c++ compiler) the following: //my first program in C++ Hello World! include using namespace std; int main () {cout << "Hello World!"; return 0;} I opened Qt source file and copied the exact same code and i can't build or run. Thank you for your responses to this simple problem.

    Read the article

  • C# Console Application Output to .csv file

    - by Zinn
    I am trying to make a program that will show the numbers: 1, 10 +30 2, 40 (the scale goes up in this pattern by adding 20 to the last number added) 3, 90 +50 4, 160 5, 250 +70 So far I have this code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO;// namespace Myloop { class Program { static void Main(string[] args) /// </summary> { StreamWriter myOutputStream = new StreamWriter("loopdata.csv"); int forloop; for (forloop = 1; forloop < 21; forloop++) Console.WriteLine(forloop); Console.ReadLine(); myOutputStream.Close(); } } } This is showing the first sequence of numbers 1 - 20, but could anyone give me any guidance how to do the other sequence next to it in the console application and how I can output these to a .csv file, as the information I have so far doesn't appear in the .csv file

    Read the article

  • Compilation failing - no #include - boost

    - by jwoolard
    Hi, I'm trying to compile a third-party library, but g++ is complaining about the following line: typedef boost::shared_ptr<MessageConsumer> MessageConsumerPtr; The strange thing is, there is no #include directive in the file - and it is clearly supposed to be this way; there are about 60 files with the same (or very similar) issues. Clearly if there was an #include directive referencing the relevant boost header this would compile cleanly. My question is: how can I get g++ to somehow automagically find the relevant symbol (in all instances of this issue, it is a namespace that can't be found - usually std:: or boost::) by either automatically processing the relevant header (or some other mechanism). Thanks. Edit My current g++ call looks like: g++ -fPIC -O3 -DUSING_PCH -D_REENTRANT -I/usr/include/boost -I./ -c MessageInterpreter.cpp -o MessageInterpreter.o

    Read the article

  • SQL alert for a stored procedure?

    - by superdupersomething
    I have a SQL 2005 setup and am rather new :) Been cracking at this for a few hours and I just need some help. I have been able to setup alerts successfully for the standard "SQL server performance events", its fun. So I already have email alerts working. However I need the alert thing to run a stored procedure I have created, and depending on its output it will alert me or not via email. So far I have been trying to use the WMI events, but I keep getting an error "The @wmi_query could not be executed in the @wmi_namespace provided. Verify that an event class selected in the query exists in the namespace and that the query has the correct syntax" the query definitely works so I have no idea.. is there a different way to do this?

    Read the article

  • question about soapClent in php

    - by Alejandra
    Hi guys! I have a question, I´m developing a web page and I communicate with a server via SOAP. my code is in php. $client = new SoapClient(null, array("location" => "$serverpath", "uri" => "$namespace", "style" => SOAP_RPC, "use" => SOAP_ENCODED )); try { $returnedValue = $client->getInfo($user); } catch (SoapException $exception) { $returnedIDValue = "Caught Soap Exception: $exception\n"; } the problem is the following, when the SOAP services are down, I do not get any exception, the program only stops. any suggestion? I would like to handle gracefully that case. Thanks in advantage Alejandra

    Read the article

  • trying to sort a simple string in c++

    - by every_answer_gets_a_point
    #include "stdio.h" #include "conio.h" #include <iostream> using namespace std; int main (void) { char my_char[] = "happy birthday"; int i; bool j=false; char my_char_temp[1]; do { for (i=0;i<sizeof(my_char)-2;i++) { j=false; if (my_char[i+1] < my_char[i]) { my_char_temp[0]=my_char[i+1]; my_char[i+1] = my_char[i]; my_char[i] = my_char_temp[0]; j=true; } } }while (j); cout << my_char; } what am i doing wrong? im just trying to sort the letters within the char the output i get is completely wrong

    Read the article

  • C# - opening process and changing window position

    - by bartq
    I want to open from c# an application (standalone flashplayer) and set it position to (0,0) on the screen. How can I do this? So far I've managed to open flashplayer: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace swflauncher { class Program { static void Main(string[] args) { Process flash = new Process(); flash.StartInfo.WindowStyle = ProcessWindowStyle.Normal; flash.StartInfo.FileName = "D:\\development\\flex4\\runtimes\\player\\10\\win\\FlashPlayer.exe"; flash.Start(); } } }

    Read the article

  • Regex doesn't work properly

    - by oneofthelions
    I am trying to implement a regular expression to allow only one or two digits after a hyphen '-' and it doesn't work properly. It allows as many digits as user types after '-' Please suggest my ExtJS Ext.apply(Ext.form.VTypes, { hyphenText: "Number and hyphen", hyphenMask: /[\d\-]/, hyphenRe: /^\d+-\d{1,2}$/, hyphen: function(v){ return Ext.form.VTypes.hyphenRe.test(v); } }); //Input Field for Issue no var <portlet:namespace/>issueNoField = new Ext.form.TextField({ fieldLabel: 'Issue No', width: 120, valueField:'IssNo', vtype: 'hyphen' }); This works only to the limit that it allows digits and -. But it also has to allow only 1 to 2 digits after - at most. Is something wrong in my regex? hyphenRe: /^\d+-\d{1,2}$/,

    Read the article

  • Segfaults with singletons

    - by Ockonal
    Hello, I have such code: // Non singleton class MyLogManager { void write(message) {Ogre::LogManager::getSingletonPtr()->logMessage(message);} } class Utils : public singleton<Utils> { MyLogManager *handle; MyLogManager& getHandle { return *handle; } }; namespace someNamespace { MyLogManager &Log() { return Utils::get_mutable_instance().getHandle(); } } int main() { someNamespace::Log().write("Starting game initializating..."); } In this code I'm using boost's singleton (from serialization) and calling Ogre's log manager (it's singleton-type too). The program fails at any trying to do something with Ogre::LogManager::getSingletonPtr() object with code User program stopped by signal (SIGSEGV) I checked that getSingletonPtr() returns address 0x000 But using code Utils::get_mutable_instance().getHandle().write("foo") works good in another part of program. What's wrong could be there with calling singletons?

    Read the article

  • Programmatically find maximum static array size in C++

    - by GuyGreer
    I am curious whether it is possible to determine the maximum size that an array can have in C++. #include <iostream> using namespace std; #define MAX 2000000 int main() { long array[MAX]; cout << "Message" << endl; return 0; } This compiles just fine, but then segfaults as soon as I run it (even though array isn't actually referenced). I know it's the array size too because if I change it to 1000000 it runs just fine. So, is there some define somewhere or some way of having #define MAX MAX_ALLOWED_ARRAY_SIZE_FOR_MY_MACHINE_DEFINED_SOMEWHERE_FOR_ME? I don't actually need this for anything, this question is for curiosity's sake.

    Read the article

  • Getting input in system() function (Mac)

    - by Alex
    #include <iostream> using namespace std; int main() { short int enterVal; cout << "enter a number to say: " << endl; cin >> enterVal; system("say "%d"") << enterVal; return 0; } Is what I am currently trying. I want the user to enter a number and the system() function says it basically. The code above has an error which says " 'd' was not declared in this scope ". Thanks in advance.

    Read the article

< Previous Page | 99 100 101 102 103 104 105 106 107 108 109 110  | Next Page >