Questions tagged [c++]

37190 questions
2

votes
0

answer
312

Views

Autogenerate Stub code in C++ to access a webservice?

I'm chancing my arm with this question. I'm looking for a tool which will avoid doing a lot of coding by autogenerating much of the code to access a webservice. I'm trying to help out someone who uses a 4GL system which doesn't support webservices. However they can access a win32 dll - which looks...
Ian
2

votes
0

answer
47

Views

program doesn't output any choice bigger than 9

I am quite new to C++ and been trying to make my own traveling program. For some reason, after pushing back the information into vectors, upon request of output anything bigger than 9 the program refuses to output it. For example, there are 10 cities in the program, and i chose to visit cities 1 2 3...
Anastasia Richardson
2

votes
0

answer
59

Views

C# Dissasembly - Find variable name from memory address

I'm debugging some C# code in the Visual Studio (2017) Disassembly and I wanna know if I can find variable name by the a physical address. I have some variable in my program at the location of the base pointer+30h address: 00007FFEEB4B19DB mov dword ptr [rbp+30h],eax 00007FFEEB4B19DE mov...
Or Yaacov
2

votes
0

answer
40

Views

Update rows from included table

I use EF 6. I select row from the users table and use .Include to also get the address (etc...). Now I want update that address data. How can I do it? This code updates only the users table: var MyUser = db.Users.Include(b => b.Address) .Where(x => x.MISPAR_ZIHUY.Equals(123456)) .FirstOrDefault(); d...
user1012506
2

votes
0

answer
236

Views

Passing a pointer to a pointer variable from Fortran 77 to C

I have to write some code that mixes Fortran 77 with C. Suppose I have a C function with signature void foo(int ** x); Thus, if I were calling foo in C, I might have int x_val = 42; int * x_ptr = &x_val; foo(&x_ptr); Now suppose I have this in Fortran 77: integer x x = 42 If I pass x to foo, that w...
Amittai Aviram
2

votes
0

answer
60

Views

c++ permission slip idiom?

I'm doing a university programming project, cutting details short I'm making a game dev framework which I want to be very hard to get wrong (plenty of static and type safety) I found myself with a problem which I though required the Attorney-Client idiom, wherein only an Actor can create a Component...
scott_r_howell
2

votes
0

answer
267

Views

Bandwith usage monitor returns excessive number

I've got the following code that is supposed to measure the current download and upload speed. The issue I'm facing is that there are often usages recorded that my network and/or internet connection can't even handle (above my bandwidth). public static IStatistics GetNetworkStatistics(string interfa...
Jeroen Vannevel
2

votes
0

answer
37

Views

Is it possible to prevent a user from setting a property on the command line?

In an msi package produced by wix, how can I prevent a user from overriding a property via the command line? I know properties can be scoped by marking them PUBLIC or private. However when I use a private property for a launchcondition, my installer fails in the ExecuteSequennce. private = "true" OR...
BdN3504
11

votes
0

answer
1.5k

Views

websockets library for .net 3.5 [closed]

I need to work with websockets in .net 3.5., however, most implementations require .net 4 or 4.5 ... Does anyone know of or have recommendations for a good opensource C# websockets implementation that is actively maintained and is compatible with .net 3.5?
Novalis
2

votes
0

answer
197

Views

Is it possible to let IntelliSense change the name of a renamed variable and automatically let it remove the old name?

I have a question regarding IntelliSense in Visual Studio 2015: "Is it possible to let IntelliSense change the name of a renamed variable and automatically let it remove (a part of) the old name? " To explain this , I will give an example: I have a variable named 'loadedDocument': public void AddSam...
Mike van Donselaar
2

votes
0

answer
270

Views

Setting Cookie Domain in CometD

CometD .NET is throwing an exception when calling the setCookie(string, string) method on BayeuxClient because I haven't set a domain for these cookies, but I don't see a property or method to set the domain, and none of the overloads on setCookie(...) take a domain as a parameter. Code: this._bayeu...
lukiffer
0

votes
0

answer
661

Views

Unable to export CSV file from web method

I'm trying to download CSV file from web method but I'm getting "Server cannot append header after HTTP headers have been sent" error after the server function is called How do I fix it? here is the client code $.ajax({ contentType: 'application/json; charset=utf-8', dataType: 'json', type: 'POST',...
Tsahi
2

votes
0

answer
82

Views

NotifyProperty not triggering

I've got two buttons on the same page, one just below my gallery and one in a bottom navigation bar. Both commands trigger but the bottom one is broken. It never goes to my NOTIFYProperyChanged This is the method just before the NotifyProperty should be called. public async Task ExecuteP...
JsonDork
2

votes
0

answer
33

Views

Only get a searched Id data in datagridview,renaming data should not be visible

OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = customer.Properties.Settings.Default.Db; OleDbDataAdapter sda = new OleDbDataAdapter(@"SELECT tbl_Customer.CustomerID,tbl_Customer_Trans.Date,tbl_Customer_Trans.DailyEntry,tbl_Customer_Trans.DailyInt, tbl_Customer_Trans.Fine FRO...
akilesh khoday
2

votes
0

answer
936

Views

Create custom Excel pie chart labels

I'm programmatically creating pie charts in Excel using C#. I need to add some custom labels for the slices. Basically, I want the labels for slices on the left hand side of the pie to start at the top left of the chart area and go down. On the right side the same thing. My question is, how can I fi...
nickfinity
4

votes
0

answer
94

Views

Does a struct with an array filed make sense?

I've the following struct with an array as second field: public struct UncNumber { private double _value; private DependsOn[] _dependencies; public double Value { get { return _value; } } public DependsOn[] Dependencies { get { return _dependencies; } } public UncNumber(double value, DependsOn[] dep...
Wollmich
2

votes
0

answer
117

Views

Sharing configuration across multiple tracesources

I'm stuck with TraceSource configuration. I have a lot of TraceSource following the "one per class pattern" and now I would like to configure all of them in a app.config. Is it possible ? I add that the TraceSource are in a .dll and I would like to use the .exe app.config. Thanks for your help. Vinc...
user1683130
2

votes
0

answer
343

Views

Hook minimize event of third party application

I have following hook class: public sealed class Hook : IDisposable { public delegate void Win32Event(IntPtr hWnd); #region Windows API private const uint WINEVENT_OUTOFCONTEXT = 0x0000; [DllImport("User32.dll", SetLastError = true)] private static extern IntPtr SetWinEventHook( uint eventMin, uint...
Alex Zhukovskiy
2

votes
0

answer
52

Views

Mapping Database entries to Objects in C#

I have table in database which look like this; ID P_ID ATTRIBUTE PARENT_ID SEQUENCE ---------------------------------------------------- 1 1 INDIVIDUAL // return the list contains same P_ID with no PARENT_ID, 2 1 FIRST_NAME 1...
trighati
2

votes
0

answer
61

Views

How to write templates with std::basic_string for C character types?

The type for std::basic_string (char, wchar_t, ...) can't be deduced from const char* or const wchar_t*: #include template void f(std::basic_string s, chTy c) {} int main() { const char* narrowCS = ""; char narrowC = {}; const wchar_t* wideCS = L""; wchar_t wideC = {}; std::string narrowS; std::ws...
Roi Danton
2

votes
0

answer
531

Views

How can I execute the action of a custom Ribbon control in MS Office/PowerPoint from within a C# add-in?

I'm currently writing a PowerPoint 2010 C# add-in using VSTO. I am trying to execute a number of Ribbon controls which are there through custom add-ins from within my own C# add-in. For example, to find the following control and execute its click event, how would I do it?: Insert tab -> "Addin X" gr...
Chris Adams
2

votes
0

answer
29

Views

Barracuda Email Encryption

I need to encrypt an email using Barracuda. As i saw, they offer 2 clients for email encryption (hardware and cloud based) https://www.barracuda.com/resources/Barracuda_Email_Security_Gateway_WP_Securing_Email_with_Email_Encryption_US Since I'm not familiar with the topic, wanted to ask if there is...
Filip5991
2

votes
0

answer
44

Views

How can I read metadata from .slx file with C#?

I am working with MATLAB. When I create .slx model and use next MATLAB code for insert metadata. `h = load_system(pathToFile); set_param(h, 'Metadata', properties)` MATLAB write my data in .mxarray file in .slx. How can read metadata of .slx file or from .mxarray with C#.
4

votes
0

answer
213

Views

SlowCheetah not transforming for EntityFramework Migrations

I'm using EF Code-First Migrations: https://msdn.microsoft.com/en-us/data/jj591621.aspx add-migration, update-database, etc. all called from the Package Manager Console in VS. I'm also using SlowCheetah to manage the various environments we have, notably including managing the fact that each develop...
Brondahl
2

votes
0

answer
437

Views

How to Localize Html email templates

I'm building a localization functionality in an mvc3 app and I have localized the bulk of the application, but there will be email templates, that are html, that I need to localize along with the other application functionality.
DD84
2

votes
0

answer
54

Views

DB Context query ToDictonary where values are the list of enties

I am trying to use the ToDictionaryAsync method on a dbcontext but can't figure out how to designate they values for the dictionary. Due to performance I need to pull in the main table and some of its relations and work on that set. To speed things up later on I thought a dictionary would help. I a...
Greg
2

votes
0

answer
36

Views

How to automatically add other library when I create a project in Visual Studio?

When I create a C# Console Project in Visual Studio, only using System; is imported. How to automatically import the below while creating a Project? using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Collections;
Nish
2

votes
0

answer
67

Views

How can I create a custom filter for NUnit 3 programmatically, with ITestFilterService and/or ITestFilterBuilder

TLDR: how to programmatically filter NUnit 3.x tests based on partial testname, regex or (partial) category names. I'm converting a project from that has its own filter mechanism for running tests from NUnit 2.6 -> NUnit 3.8. The filters I am trying to support are partial string match on the name, r...
Abel
2

votes
0

answer
225

Views

TreeView MasterDetails with ToggleButton

I want to create a MasterDetails TreeView with styles. From this question I wanted to reuse the toggle button Here is my XAML Please excuse the big block of XAML, but I really have no clue where the exception comes from. But now I get a StaticResourceHolder Exception with no more information. I just...
Mare Infinitus
2

votes
0

answer
184

Views

Print data of one column of data gridview in print document in C#?

int height = 300; int i = 0; while (i < PurchaseDepartDataGridView.Rows.Count) { height += PurchaseDepartDataGridView.Rows[0].Height; e.Graphics.DrawString(PurchaseDepartDataGridView.Rows[i].Cells[0].FormattedValue.ToString(),PurchaseDepartDataGridView.Font,Brushes.Black, new Rectangle...
Farhan Khan
2

votes
0

answer
185

Views

how to use 2 mic in android ics 4.0.3

I am working on AM3715 based custom designed board with Android ics 4.0.3.In the board there are 2 mic ,headset works fine,but onboard mic not works...I want to change the headset configuration for onboard mic .I changed signals in /sound/soc/codec/twl4030.c ,REG_ANAMIC as 0x01 for sub mic and comm...
Anu
2

votes
0

answer
885

Views

namespace aware omnicomplete in vim

I have been trying to find an answer to my trouble with no luck, so here is my question. Our C++ classes are defined in several namespaces. So, frequently, class members have a type that belongs to other namespace. For those cases, vim's omnicompletion feature does not work. STL members and local va...
Eguzki
2

votes
0

answer
734

Views

Magento API in C# - throwing content type exception

When i am trying to use the Magento Product download webservice call in my C# application. I am getting some content type Mismatch error. Could you please help me? Here is my code: using (Mage_Api_Model_Server_V2_HandlerPortTypeClient proxy = new Mage_Api_Model_Server_V2_HandlerPortTypeClient()) {...
Stalin
2

votes
0

answer
81

Views

How to make available a .NET DLL with a service reference incorporated and use it from a VB6 application

Hi everybody and pardon me in advance if that question has already been covered but I couldn't find a precise answer before. My situation is: I have developed a library that has a service reference (because it calls a SOAP Web Service). The web config has some parameters set like proxy and so on. I...
DioBrando
2

votes
0

answer
63

Views

How should fields of a struct be accessed through a pointer to a pointer? [closed]

Say I have a function f(struct_t** p) that manipulates a struct s through p. f calls a function g(struct_t** p) that will reallocate s such that the caller of f will still be able to access s through *p after f returns. I can think of three ways to handle access to fields of s in f: Assign struct_t*...
jschmidt
2

votes
0

answer
123

Views

Buttons on Dialog align differently in release and debug mode in MFC

My dialog with OK and Cancel buttons looks good in Debug mode and as designed in designer, but in release mode the margins set in the designer are not honored and the buttons simply sit right on the bottom edge of a dialog. Any ideas how to fix that issue so it looks identical in debug and release m...
2

votes
0

answer
165

Views

Communication between VS extension and user controls in design mode

I'm writing a Visual Studio extension along with a WPF user control library that will be included in the VSIX package. I have an interesting requirement that involves providing data to my user controls during design mode. I'm looking for a way for my user controls to access resources that are initia...
jason
2

votes
0

answer
77

Views

Duplicate Insertion into database

I'm currently experiencing a funny issue here, each time I insert a new item with EntityFramework, I get to see a new Item submitted first before the real time but with the same entries(properties) and a String[] Array in the last column. I actually have a model defined thus public class Supervisi...
2

votes
0

answer
88

Views

Generating code into an existing C# class

I am working on a project that makes programming on visual studio easier for non-experienced programmers who need to create some specific programs.To do this i want to take advantage of code-generation.I am providing these users with a project template that provides them with a base structure and fi...
techRooky
2

votes
0

answer
68

Views

Calling OnDeltapos() from OnPointerdown() in MFC

I have a CSpinButtonCtrl class subclassed called MySpinButtonCtrl. In this class I have an OnDeltapos event declared which is in charge of increment and decrement numeric values on my spinner: void CMySpinButtonCtrl::OnDeltapos(NMHDR* pNMHDR, LRESULT* pResult) { NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)p...
Alberto Bricio