all groups > visual c > april 2007
Filter by week: 1 2 3 4 5
Thread deadlock inside CString::AllocBuffer and sudden crashes
Posted by rajayan at 4/30/2007 3:28:38 PM
Jochen Kalmbach [MVP] wrote:
> *Hallo rajayan!
>
> > Now that we are towards the fag end of the project, we are getting
> > occasiona
> > lly hit by sudden crashes where our top level exception handler is
> not
> > even
> > able to come into play and create the required .dmp file. We also... more >>
Crash on target PC (not dev PC) when hosting a WinFormsView in a CFrameWnd?
Posted by Duncan Smith at 4/30/2007 2:25:20 PM
Hi All,
Grateful if anyone has any suggestions here? I have a VS2005 MFC app
which hosts several types of views in CFrameWnds - one of which
contains a managed control hosted in a CWinFormsView
Everything works well on my dev pc (and other peoples dev pcs), but
when I try and instantiate t... more >>
A mysterious undocumented keyword?
Posted by gil NO[at]SPAM waves.com at 4/30/2007 9:19:51 AM
Hi,
In VS 2005 (SP1), the following code does not compile:
=============
typedef int _sptr ;
_sptr p = 1;
=============
the compiler emits the following:
source1.cpp(1) : warning C4091: 'typedef ' : ignored on left of 'int'
when no variable is declared
source1.cpp(2) : error C4430: ... more >>
How do I execute a dos command from a .NET VC++ program
Posted by Kueishiong Tu at 4/28/2007 10:36:00 PM
I have a .NET VC++ program, I want to execute some dos command from the
program, e.g. copy some file, and etc. How do I do that?... more >>
Bug in VC7? Or my mistake?
Posted by ckkwan NO[at]SPAM my-deja.com at 4/28/2007 7:06:21 PM
The code below yield different results by just moving the _T("Phone")
to second line.
struct { TCHAR* ColName; CString& Value; } Columns[] =
{
{_T("Name"), m_Name}, {_T("Add1"), m_Add1},
{_T("Add2"), m_Add2}, {_T("Add3"), m_Add3},
{_T("Postcode"), m_Postcode}, {_T("State"), m_... more >>
Unmanaged code Debugger problem
Posted by Paolo Pagano at 4/27/2007 5:41:29 PM
I have a VS2005 solution with two projects:
1) a .net windows forms application (which references)
2) a managed C++ CLR library (using MFC ia a Shared DLL) .
In one C++ managed class, calling unmanaged code like the one below, the
debugger jumps back an forward
on wrong s... more >>
wlanapi.dll c#
Posted by Nelson Guerrero at 4/27/2007 4:41:10 PM
Hi, I'm trying to obtain the profile list using the wlanapi.dll but I'm
receveing errors. The following code is what I've done so far. I took
the structures and functions definition from
http://msdn2.microsoft.com/en-us/library/ms706716.aspx
[StructLayout(LayoutKind.Sequential, CharSet ... more >>
Thread deadlock inside CString::AllocBuffer and sudden crashes
Posted by rajayan at 4/27/2007 10:53:07 AM
Am facing a issue similar to what we have under
[url]http://www.codecomments.com/archiv[/url]<...-11-706874.html
I work for a imaging system software and modules are a mixture of pure
ATL d
ll, "ATL using MFC" components, COM EXE servers, regular MFC dll, MFC
EXE an
d extension MFC dlls.
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Importing a type library into unmanaged code with /clr switch - linker errors
Posted by Duncan Smith at 4/27/2007 9:53:34 AM
I have a VS2005 C++ MFC project which #imports a type library. The
goal is to introduce some managed code eventually, but for starters I
just need to set the /clr compiler option and build the project.
The type library is imported like so:
#import <LtipClient.tlb> no_namespace named_guids
... more >>
Getting Unmanaged struct data to C#
Posted by jcteague NO[at]SPAM gmail.com at 4/27/2007 9:21:14 AM
What is the best way to get a set of unmanaged structs to C#.
I have the following structs:
typedef struct
{
unsigned char Angle[4];
unsigned char Rayon[3];
} StructPointPolaire;
//---------------------------------------------------------------------------
typedef struct
{
StructPoint... more >>
left handed use of conditional
Posted by Nicholas M. Makin at 4/26/2007 9:58:29 PM
I was just thinking that I understood the conditional operator when I coded
the following expecting it to fail:
int a= 10, b= 20, c= 0;
((a < b) ? a : b) = c; // a=0
a=20; b= 10;
((a < b) ? a : b) = c; //b=0
Now since the expresion 5 = c is not valid I did not expect the above to
work. ... more >>
'exception' object in VS2005?
Posted by Michael Bray at 4/25/2007 12:37:12 PM
I'm converting a project from VS2003 to VS2005, and one of the most common
errors that I'm getting is on my try/catch blocks, where I used to do:
try { ... }
catch (exception &e) { ... }
VS2005 is complaining that 'exception' isn't recognized... anyone know
what the resolution is to this... more >>
Date Format
Posted by William C. Clay at 4/25/2007 8:52:37 AM
I have an application that uses the Date in this format: 200741 for April 1.
I need it to be like this: 20070401. Here is my code that generates the
date:
string sFileDate = DateTime.Now.Year.ToString() +
DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString();
How can I get it to writ... more >>
Unhandled exception in "wincore.cpp" file
Posted by Mohammad Omer at 4/25/2007 5:10:52 AM
Hi,
I am working on MFC base SDI application using vs2k5. When I close my
application, exception shows up in "wincore.cpp" line 449, statement
"lResult = CallWindowProc(oldWndProc, hWnd, nMsg, wParam, lParam);"
exception message is,
"Unhandled exception at 0x5a906a03 in test.exe: 0xC00000... more >>
Inheritance in managed c++.
Posted by A n g l e r at 4/25/2007 12:00:00 AM
Hello everybody. I've got a bizarre problem concerning inheritance of
the managed c++ code when using templates. Consider the following
wrapper for the unmanaged c++ class:
template <typename SomeType>
public ref class SomeManagedClass
{
private:
SomeType* pSomeObj;
public:... more >>
C++/CLI System::ServiceModel Problem
Posted by NeToKo at 4/24/2007 7:54:45 PM
when i try to compile my code with 'using namespace
System::ServiceModel' i get:
error C2039: 'ServiceModel' : is not a member of 'System'
i've installed WCF and WPF extensions for Visual Studio 2005 and after
that i see 'Net Framework 3.0' under C# new project, with WCF Service
Library... tr... more >>
GetLogicalDrives doesn't retrieve remote drives on Windows Vista
Posted by Luis Antonio Rosello Garcia at 4/24/2007 8:38:00 AM
Hi,
I have a big problem with a Visual C++ 6.0 function that retrives the
logical drives and types in the local system.
This function works perfectly on Windows 98, NT, 2000, XP and 2003, but I
have tested it on Windows Vista and it doesn't retrieve remote network
drives. It must retrieve a ... more >>
System::ServiceModel problem
Posted by yy at 4/24/2007 7:43:08 AM
when i try to compile my code with 'using namespace
System::ServiceModel' i get:
error C2039: 'ServiceModel' : is not a member of 'System'
i've installed WCF and WPF extensions for Visual Studio 2005 and after
that i see 'Net Framework 3.0' under C# new project, with WCF Service
Library... tr... more >>
WM5 problem
Posted by Tym at 4/24/2007 12:00:00 AM
Hi guys and gals!
Been trying to program following Maarten Struys' demos on the SMS
intereception and I'm having severe problems.
First of all, I'm a VBer not VC, though for this I have tried to work my way
through VC!!
I took the BASIC code from Marteen's example, and derived this:
... more >>
Debugging Unmanaged Library From Managed Library
Posted by Howard Swope at 4/23/2007 12:08:03 PM
I have a series of third party libraries for which we have licensed the
source code. These are unmanaged libraries written in C++ which I am able to
build without any trouble. I am trying to setup my environment so that I can
step into their code form my managed .dll written in managed C++ (.N... more >>
Forms and Label
Posted by Allen Maki at 4/22/2007 8:40:44 PM
I wonder if you could help.
The event handler code below, will allow the user to change the phone number
and write it on a label of a message box. I want to replace the message box
with a dialog box.
Can anybody help me replace the message box below to a dialog box. In other
words. I wan... more >>
serialport read buffer
Posted by chenatcr NO[at]SPAM yahoo.com at 4/22/2007 2:13:13 PM
Hello,
I added a serial-USB converter to my laptop, it appear as USB serial
port COM4, and I wrote an application to read 78k data from this port.
In my VC++ express code, I defined ReadBufferSize = 78k, and
ReceivedBytesThreashold = 78k so that I can get the whole data with
one ReadExisting(... more >>
tracking handle
Posted by manjub at 4/22/2007 1:34:32 AM
Hi,
I have a question regarding a reference to tracking handle.
In older C++ if I write below code would add new node to the linked
list.
Object* o = linkList->FirstNode;
while ( o != null ) {
o = o->nextNode;
}
o = newNode;
However in Visual C++ 2005.NET, I wrote the following... more >>
MAIL HELP!
Posted by CATALENA at 4/22/2007 12:46:00 AM
HOW DO I PUT MY CONTACTS ON THE FRONT PANE OF WINDOWS MAIL? I'M ABLE TO ENTER
MY CONTACTS AND LOOKED AROUND TO SEE IF CUSTOMIZED AREA WOULD ALLOW ME TO PUT
MY CONTACTS IN THE FRONT PANE AREA, BUT I COULDN'T FIND IT. IN OUTLOOK
EXPRESS, IT WAS THERE. I HAVE WINDOWS VISTA AND A DELL PRODUCT. THE... more >>
Windows XP x64 Professional. Service Pack 2. Failed install 800700
Posted by PedroAsani at 4/21/2007 8:26:01 PM
I am having trouble with 3 Updates for XP x64. Service pack 2, RDC update
925876 and Security Update 928843. I have enabled verbose logging, followed
the steps in 873148, but there is no Error 5. I have no idea where to go. Can
anyone help? I emailed the Automatic Update helpers, but they just... more >>
Bug in dotnet 2.0 ? Retrieving properties for desktop folders
Posted by Martin jensson at 4/20/2007 3:53:10 PM
Hi,
If I get the ACL of a desktop folder, I do not get the 'right' security
settings. For example the right Read is true when I check using the security
properties
in the windows explorer.
The strange thing is that in comparison with a normal folder (say c:\temp)
in the code below bReadAll... more >>
class instances in C++
Posted by Max 1e6 at 4/19/2007 5:20:01 PM
I have an application form named Form1.h. The code for this form is a
namespace (MyNamespace) with two classes in it (Form1 and MyClass). Form1 has
windows designer code and some button event handlers. In those event handlers
I want to reference methods in the MyClass class. I use syntax like ... more >>
CLI ref structs. Is there any benefit to using it.
Posted by DaTurk at 4/19/2007 1:01:53 PM
Hi,
I'm coding a layer into my application using CLI, between a unmanaged
and a c# layer. So, I have to marshal some unmanaged c++ structures
to structures usable in c#.
My solution was to marshal the unmanaged C++ structures to CLI ref
structs, these being usable in the c# layer. Why I d... more >>
Mixed DLLs, VS 2003 and 2005
Posted by rwf_20 at 4/19/2007 12:23:44 PM
My setup consists of two DLLs and an EXE, all C++.
The EXE is unmanaged, and calls an unmanaged DLL. The unmanaged DLL
calls a managed DLL.
If I build all three in the same version of VS, everything works as
expected.
In practice, I can match the DLLs, but not the EXE (that is, it could
... more >>
SIGNED does not allow negative values???
Posted by Dani at 4/19/2007 4:54:03 AM
Hi!
I'm developing for many years, by i have never encountered such problem in
VC++!
I tried doing the simplest test:
Create new solution -> Win32 project...
In the main procedure I wrote this:
int i=-1;
And breakpoint on the next line.
The value of i is 0xffffff !!!
I tried writ... more >>
C++/CLI only way to use C++ for .NET?
Posted by Andreas Schmitt at 4/18/2007 10:06:43 PM
Hi,
I am working on a small fun programming project (AntMe if anyone knows
it) which provides code examples for C# and Visual Basic 2005
After doing some programming with C#, I was going to try to write a
library for it with C++ too.
I never worked with .NET before only with plain C++ so ... more >>
Exporting C++ classes as ordinals (via a def file)
Posted by 2b|!2b==? at 4/18/2007 6:06:50 PM
I want to export my C++ classes in a DLL, using ordinal # - rather than
by name. Will anyone care to enumerate through the steps required to do
this?
I am already failiar with exporting classes and symbols (both C++ and C)
from a DLL. In the case of C functions, i also know how to export th... more >>
Emulate HyperTerminal
Posted by C a r l o s A n t o n i o at 4/18/2007 10:29:01 AM
Hello,
I have to submit a file via HyperTerminal using my PC's internal modem on a
daily basis. Does anybodoy know how to accomplish this in VS2005? Any
language is good, VB preferred. Thanks.
Regards,
C a r l o s A n t o n i o
... more >>
exporting a struct with an array from a C++ dll to be accessed in C#
Posted by AM at 4/18/2007 9:21:39 AM
Hi,
I have a C++ Dll that has a function that is being exported as
shown below
extern "C" __declspec(dllexport) validationResult __stdcall
_validateData(double dataToMat[], int time);
A structure is defined in the header(.h file) as shown below
struct validationResult
{
int r... more >>
7.1 vs 8.0: Inheritance and Events
Posted by rwf_20 at 4/18/2007 7:06:07 AM
Consider the following (/clr:oldSyntax):
// myPanel.h
public __gc class myPanel {
public:
__delegate void PanelActivationHandler();
__event PanelActivationHandler* PanelActivated;
virtual void OnPanelActivated() {
std::cerr << "myPanel::OnPanelActivated()\n";
}
};
public _... more >>
How do I program an ID/password change to a Service, Scheduled Job
Posted by Ken at 4/17/2007 5:52:00 PM
I need to change the logon/password of an established Windows Service; a
Scheduled Job, Autologon.
Can I do this with C++?... more >>
Forms and labels
Posted by Allen Maki at 4/17/2007 2:54:34 AM
Hi Everybody,
I am new to Famework Programming and I need your help.
In Visual C++ .NET
Forms.
Labels.
If I want to add XXXX to the label, I can do that through the "Text"
property in the property editor. But I want to add the XXXX during run
time. In other words I w... more >>
TCP/IP comms problems between WinXP and DOS
Posted by Howard Smith at 4/17/2007 12:28:01 AM
I am using VC++ 6.0 (with SP5 installed). When using WinXP this is with SP2
installed.
I am developing an instrumentation system comprising a set of networked PCs
connected using TCP/IP TCP links. Communications on the Windows PCs use a
class derived from CAsyncSocket(). I have written client... more >>
fast access to members of structure
Posted by A n g l e r at 4/17/2007 12:00:00 AM
Hello everybody.
I've got such an aching me question concerning fast & well optimized
access to members of a structure (or class) and ways that VC compiler
handles it. Let's imagine the following structure and an array of its
type:
struct SSth1
{
int nMbr1, nMbr2, nMbr3;
} aSth1[1... more >>
Compile time constants
Posted by newscorrespondent NO[at]SPAM charter.net at 4/16/2007 11:43:43 PM
Is there a way with Visual Studio 2003 and 2005 to list the name a value of
compile time constants like those created with #define statements.
Right now I have the need to use the same C# code in 2003 and 2005 and need
to know which version is doing the work. I could create one but if there is
... more >>
error LNK2001: unresolved external symbol
Posted by sadegh at 4/16/2007 7:00:25 AM
Hi
I have a problem with my program in VC++6
When I compile it, the following errors are listed. I spend a lot of
time on the groups.google.com to find its reason, but none of
comments
could not help me. Does any body know what is the problem?
By the way, I have already added the matrixop.h ... more >>
'static ' : ignored on left of 'const double' when no variable is declared
Posted by 2b|!2b==? at 4/15/2007 6:06:55 PM
I'm getting this rather cryptic com,pile time error when I compile my
code. I have the following lines in my header file I know I could use
anonymous namespaces to get around this but I was being lazy and simply
wanted to do it the old "C" way).
The header looks like this:
#pragma once
... more >>
Frustrating LNK2001 issue with VC++ 6.0
Posted by walkerfx at 4/15/2007 4:39:07 PM
Hi Everyone,
I have been trying resolve this issue for many hours and am not making
any progress. I have a DLL that I'm updating with some new 3rd party
libraries. However, there appears to be a conflict causing the
following link errors:
------------
error LNK2001: unresolved external symbo... more >>
print the current time on the screen.
Posted by Allen Maki at 4/15/2007 2:47:21 PM
Hi everybody,
I need help.
I want to print the current time on the screen. After research I managed to
run the codes below in regular C++. But I could not make it to run in .NET
Framework environment. Can anybody tell me how to make these codes to work
in .NET Framework or sho... more >>
Equivalent ShellExecute in C++/CLI or NET
Posted by Tomas at 4/14/2007 11:22:00 AM
Hello,
Somebody knows which is the equivalent one in C++/CLI ?
HINSTANCE ShellExecute(HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
--
Tomas... more >>
Host CLR
Posted by timor.super NO[at]SPAM gmail.com at 4/13/2007 6:08:21 AM
Hi all,
I'm trying to use a .net api from unmanaged MFC code.
I'm trying to use ClrCreateManagedInstance api, but as shown above,
my
var pDisp equals null before the ClrCreateManagedInstance call.
Can you correct my code ? (Or any other way to do that ?)
#include "mscoree.h"
#pr... more >>
CLI with Win32 API
Posted by Micus at 4/13/2007 1:02:34 AM
Are there any good examples of making Win32 API function calls from within
managed code?
Also... Is there anyway to run a separate app [eg 'run(MyApp.exe) '] from
managed code?
TIA,
M
... more >>
Best Practice for Dealing with double inaccuracies
Posted by JBeerhalter NO[at]SPAM gmail.com at 4/12/2007 5:25:18 PM
I understand why doubles are not entirely accurate(i.e. if I store the
number .10 in a double it might actually have the value .
100000000001), I was just curious if someone could direct me toward
best practices for dealing with them.
I could cleary eschew double in favor of decimal, or just c... more >>
Dual core optimizations
Posted by Paolo Niccolò Giubelli [Axettone] at 4/12/2007 1:26:09 AM
Hi! I wrote this simple program in C++ (I'm studying some C++ applied to the
windows enviroinment) that creates a child thread:
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <math.h>
#define MAX_THREADS 1
int j,k;
DWORD WINAPI threadfunc(LPVOI... more >>
Advice needed, VS.NET versions, MC++ compiler bug, boxing and more
Posted by STG at 4/11/2007 2:30:54 PM
Greetings,
My group has an SDK that was developed 5 years ago with VC++ 6.
Over the last years, the requests for a VS.NET SDK has reached critical mass
and I am now in the process of doing that.
Actually, the first release of this 'port' is be a simple rebuild of the
unmanaged C++ SDK in ... more >>
|