-
- Returning Managed __gc Class array to function parameter... parameter stays <undefined value>
by RyanH314
- 2 Replies
- Last post
by RyanH314
-
Hi there,
I have a function which is to Enumerate Project Tasks. Each Task goes into it's own __gc class, and therefore is in a class array. With unmanaged C++ it is easy to change the data a pointer points to. However, this managed C++ seems to garbage collect when the original pointer leaves the scope.
I am using /oldSyntax line.
Here is some brief code of my function. Please
-
- AddRef and Release function of COM inteface
by George2
- 14 Replies
- Last post
by Ralf G
- Hello everyone,
I have noticed a lot of COM samples that the function AddRef and Release function of COM inteface is not synchronized to make it thread safe when dealing with adding/decreasing reference count.
Is it needed to synchronize AddRef and Release Or the COM runtime underlying implementation handles thread safe issue by itself (i.e. transparent to upper layer COM server developer)
-
- Error: Command line error D8016 : '/RTC1' and '/clr' command-line options are incompatible
by hipswich
- 14 Replies
- Last post
by hipswich
- I have an MFC application that has been in use for 6 years. Now, all I want is to use a few functions of .Net, so I changed the configuration to support Common Language Runtime (/clr). When I complie, I get the following error:
Error: Command line error D8016 : '/RTC1' and '/clr' command-line options are incompatible
I tried every option of Basic Runtime Checks (e.g. Default, StackFrames
-
- Issue about the expression int _time = GetTickCount().
by Rush hour
- 11 Replies
- Last post
by ChopperDavo
- Dear all, In my program, I used the following expression to get the current system time, i.e. int _time = GetTickCount(); In the debug mode, _time can get the right value. However, in the release mode, it never get any value. Can you help me to figure it out B.W. B-D
-
- How to do a Program That Opens When A System ON.
by Allaudeen_N_587b24
- 6 Replies
- Last post
by TilakGopi
- Hi Friends,
I like to know how to do a program that will automatically displays a welcome message or something else, when the system gets ON ( after the Desktop Appears)...
Is there anything specially done to achieve this.......
-
- Program Debug
by nwongfeiying
- 14 Replies
- Last post
by Shakje
- How do I compile a program to attach to another application to debug it
-
- Stopping Command Prompt from closing
by JBueno
- 5 Replies
- Last post
by JBueno
- Im using Visual C++ 2005 Express Edition, im new to the software and the C++ language, but i finally got the program to compile my code. Right now all im doing is printing a line, here's the simple code: #include <iostream> int main() { std::cout <<"Welcome to C++!\n"; return 0; } it successfully builds it, but the problem is that as soon as the output is displayed on th
-
- VC++ Express, how to reference a DLL (Velleman)
by zaurska
- 8 Replies
- Last post
by zaurska
- I got a Velleman K8055 USB, which came with files that were meant to let me control it using VC++. I just can't get the files to compile properly - I've never called a DLL before so I'm really stuggling - getting SDK to work with C++ in order to build DLLs was interesting enough!
Files provided .h, .lib, .cpp, .DLL + some others that I don't think are relevant.
Ive following throug
-
- Display an Unsigned CHAR as Binary and Hex
by MrBrilliant
- 7 Replies
- Last post
by Gesus Christ
- Hello everybody.
I was wondering if it was possible to display a UCHAR in binary and hex format using Visual C++ 6.0
Regards
-
- issues in build
by Maria_15565
- 1 Replies
- Last post
by Simple Samples
- i am making a phonebook application and have compiled it successfully. but when i build it i find errors like
imsc_memory.lib(imsc_memory.obj) : warning LNK4044: unrecognized option "manifestdependency:type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'"; ignored LINK : warning LNK4098: defaultlib "L
-
- Read text file to variable, write this variable to another file
by dlw10023
- 7 Replies
- Last post
by Marius Bancila
- Hello, I am new to Visual Studio and c++. I am using native., rather than managed c++ (I think and hope). I am able to read data from a file, but when I then try to turn around and write the string variable into a text file, the written-to file appears to be empty. Here is an excerpt of what I'm doing: std::ifstream fileInput; fileInput.open("SymbolList.txt",ios::in); std::ofstream fileO
-
- Looking for specific characters in a string.
by Jay Thomas
- 1 Replies
- Last post
by Jay Thomas
- I am trying to set the position of a specific character in a string for further manipulation.
What is wrong with the if ( maptextEnum->Current == 'm' ) statement. Nothing I have tried seems to work.
Thanks
StreamReader ^sr = File :: OpenText(strfile);
String^ maptext;
while ( (maptext = sr->ReadLine()) != nullptr )
{
if (maptext->Contains( "#l
-
- Missing dependancies
by GaryMcC
- 10 Replies
- Last post
by Ted.
- A friend of mine has created a small DLL in C++ using VS2005 Pro, and has sent me his entire project folder which I have loaded using VS2005 standard. I have not made any changes (basically just checking code over) to his project, and when I go to compile it, there are no errors.
However when the application that uses the DLL (late binding) tries to load it, it fails with the "application
-
- Can I write unmanaged code in C++?
by Yigael Oscar
- 5 Replies
- Last post
by Marius Bancila
- Hi,
I am new to VS2005.
I want to know if I can write regular c++ code in VS2005 or just managed code.
If not I probably need to write some code in VS6.0
-
- VC++ dialog-template
by amicalrahul
- 13 Replies
- Last post
by einaros
- Question:-
A CFormView uses a dialog-template resource. What properties must the dialog-template resource have to work correctly with a CFormView
Choice 1
WS_CHILD on WS_BORDER off WS_VISIBLE on WS_CAPTION off
Choice 2
WS_CHILD off WS_BORDER off WS_VISIBLE off WS_CAPTION off
Choice 3
-
- How to start RS232 with C++
by Luke Neher
- 2 Replies
- Last post
by Luke Neher
- This morning my boss told me that he want me to write a program to control a balance by RS232 port with c++, but I have no experience on RS232. Is there anyone can give me some suggestions
-
- DirectX
by Upinflames
- 1 Replies
- Last post
by Nishant Sivakumar
- I am currently new to Visual C++ and DirectX. A question I have is how do I put the include files and the library files into Visual C++ or the code
-
- All is fine in release mode, weird bug in debug mode
by Soth
- 20 Replies
- Last post
by Soth
- Hi,
my program works fine in release mode, but in debug mode I get a very strange behaviour,
upon the entry to the operator=, e refers to a correct location, but as some auto generated entry instructions are hit (these instructions are not generated in release mode because this function is inlined) it becomes invalid,
so what can be done to resolve this problem
Code Snippe
-
- Which sound API should I use?
by thrice
- 3 Replies
- Last post
by thrice
- I'm writing a program in C++/CLI which will need support for basic sounds, with nothing too fancy other than microphone support. Since I'm using C++/CLI, I know there are several APIs I could use, both managed and native, but I'm not sure which would suit me best, as I have never incorporated sounds into any of my programs before. Sounds will need to be played in response to simple events, and I n
-
- LNK1104: cannot open file 'gdi32lib'
by Ed de los Reyes
- 4 Replies
- Last post
by jmm433
- Using "Build" menu on Visual c++ Express Edition of my first sample source I encountered the following error:
LINK : fatal error LNK1104: cannot open file 'gd132.lib'
How do I fix it
Thanks, Ed.
-
- NetUserChangePassword returns access denied (5) -- can't figure out why
by jbreazeale
- 1 Replies
- Last post
by jbreazeale
- I am using a coding somewhat like this to do a password change:
Code Snippet
[DllImport("NetApi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern NET_API_STATUS NetUserChangePassword(
LPCWSTR domainname,
LPCWSTR username,
LPCWSTR oldpassword,
LPCWSTR newpassword
);
. . .
NET_API_STATUS status = NetUserC
-
- Assert in GetLine when exitting a console app
by DJHBeek
- 7 Replies
- Last post
by Simple Samples
- Can anyone tell me why I get the following assert when I use the X in the upper right of the console window to exit out of the following test application
ASSERT:
File: f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\afxtls.cpp
Line: 271
SOURCE CODE:
// getlinetest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include
-
- Is this the right way to pin a pointer?
by daniel mark
- 3 Replies
- Last post
by Holger Grund
- Hello all:
I found the following code in a project and would like to know whether it is right to pin down a point as follows:
Code Snippet
// System::Array* topElli
float __gc* topPtr; // pin down a pointer for the destination array float sArrayTop __gc[]; sArrayTop= __try_cast<System::Single[]>(topElli); topPtr=&sArrayTop[0];
In my opinion, fl
-
- activeX control
by koby198
- 3 Replies
- Last post
by Damien Watkins - MSFT
- hello all,
it's my first post here , and i think i'll start to visit here.
anyway,
i wrote an activeX control with some property page.
in the prop pages, there are edit boxes.
if the edit box is empty, and i click on the tab (property sheet),
my activex is crashing.
how can i catch this and prevent the crash
thank you,
c'ya
-
- c++ windows forms loop
by MoSin
- 2 Replies
- Last post
by MoSin
- Hi,
I just discovered that it is possible to use windows forms in c++. Now my problem is that I want to get into the application loop like for a game loop. What's the standard way to replace Application.Run(). In unmanaged c++, there was the translatemessage and peekmessage, but I didn't succeed in my research to find the way to do a loop in managed c++.
Thank you very much!