all groups > visual c > july 2005
Filter by week: 1 2 3 4 5
RegisterWindowMessage
Posted by Dave at 7/31/2005 8:55:41 PM
Hi,
I am sending windoew message from a c# application to c++(unmanage)
application using this code
System.UInt32 rm= RegisterWindowMessage("12345");
System.IntPtr ptr=(IntPtr)HWND_BROADCAST;
PostMessage(ptr,(int)rm,5,5);
PostMessage(ptr,WM_AAA,5,5);
but the c++(vc-6 mfc) dont catch t... more >>
Trying to mix managed and unmanaged code
Posted by chuck rudolph at 7/30/2005 10:03:02 AM
The project that I am on is going to require me to mix managed and unmanaged
code. I created a vc++ class library (.net) project bane TestLib.
I inserted the following test code in testLib.h. The code came from the MS
example on mixing managed and unmanaged code. When I build the project, I g... more >>
Attributes and events
Posted by Edward Diener at 7/30/2005 12:00:00 AM
One can specify an event as either the raw event:
__event System::EventHandler * OnSomethingChanged;
or as a series of add_,remove_, and raise_ methods:
__event virtual void remove_OnSomethingChanged(System::EventHandler *);
__event virtual void add_OnSomethingChanged(System::EventHandler ... more >>
Getting and Using IDataObject from Virtual Folders (Shell Namespace Extentions
Posted by JP at 7/29/2005 12:38:17 PM
I have an app that represents ShellFolder Items as a visual element
(listview item, etc). The code correctly performs Drag&Drop operations
EXCEPT in the case when the item being dragged is from a Virtual
Folder. The problem is that the DragSource is my app, not the Virtual
Folder, and therefore... more >>
whynot write code in stdafx.cpp?
Posted by Egbert Nierop (MVP for IIS) at 7/29/2005 12:14:59 PM
Thanks in advance for answering this question.... more >>
Making the Microsoft Web browser control Trasparent
Posted by Concorde7224 at 7/29/2005 10:51:42 AM
Hi,
I am using Microsot Web Browser control in a VC++ (.net) desktop
application (Windows forms application). How do I make this control
transparent so that if I have any other control like Textbox under the
Browser control, it is made visible (after making the browser
transparent).
-TIA-
... more >>
Why my setting doesn't work?
Posted by A programming and programmed squirrel at 7/29/2005 7:37:05 AM
I am trying to write a program similar to "ping".Like the example provided in
MSDN,I call setsockopt function to set SO_RCVTIMEO value for my raw
socket.And before I make a call to recvfrom,I call getsockopt to ensure that
the value ihas been correctly set,and it has.But recvfrom does not retu... more >>
Hard closing Socket cannot be detected
Posted by Alper AKCAYOZ at 7/29/2005 5:35:05 AM
Hello Developers,
I have developed Server and Client applications that are communicating by
TCP/IP sockets. My application is developed on Visual C++ .NET Standard v2003
Windows Forms. When one of the program is closed unintensionally, other is
automatically trying to re-connect. But, wheneve... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
How can I use C# GUI component in my MFC application.
Posted by Sushil Srivastava at 7/28/2005 6:40:02 PM
Hi Guys,
Would you be able to help me using C# GUI (with user interface component) in
my MFC application. I have used managed extension, COM-interops, etc but
problem is this C# component has user interface. how should have get window
handle from managed windows?
Thanks in advance.
Sush... more >>
Avoid "Program Database for Edit & Continue"
Posted by Mihajlo_CvetanoviƦ at 7/28/2005 5:21:49 PM
Avoid "Program Database for Edit & Continue" in VC 2003!
This option made me think I'm in Twilight Zone! The code behaves as not
intended, the breakpoints in the debugger get skipped, the only positive
thing about it is that the error is repeatable.
Consider the following code snippet (it ... more >>
Certificate export function not defined in header file
Posted by Brad at 7/28/2005 2:32:03 PM
I'm trying to write a utility to export user certificates without user
intervention. I found a function CryptUIWizExport that should do the trick
but it does not appear to be defined in the cryptuiapi.h header file even
though the documentation states it should be. I have tried creating my o... more >>
"warning C4996: 'strncpy' was declared deprecated"
Posted by Olaf Baeyens at 7/28/2005 1:55:32 PM
I am testing VC++ 2005 and I get this warning:
"warning C4996: 'strncpy' was declared deprecated"
Does that mean that they might be phased out in VC++ 2006 or higher?
Or does an alternative function exist as replacement?
... more >>
can i use JNI from a managed c++ __gc class ?
Posted by yaron at 7/28/2005 6:29:02 AM
Help: Interrupt a process while implementing
Posted by Hai Le at 7/28/2005 6:02:03 AM
Hi,
I'm trying to write a program for Smartphone 2003 device bu eVC++ 4.0. The
interface consists of couple of buttons ( i used pushbutton type), when you
press the button, the program start to implement. But I want to add on
another button which do the job of stopping the first one if presse... more >>
Catching unmanaged crashes in MC++
Posted by TheLetti at 7/28/2005 5:55:08 AM
Hello out there,
is there any possibility for me to catch or avoid crashes caused within
unmanaged code?
The situation:
I'm writing a managed wrapper in MC++, and in there I use some
unmanaged COM methods for creating thumbnails.
The problem: One special line may cause a crash, and subse... more >>
A Stupid Compilation err
Posted by Clocker at 7/28/2005 12:26:17 AM
Hello,
I never practiced C++ development in VC++.net before. (only Unix)
what does the error:
d:\C++\UMath\UAlgebra.cpp(71): fatal error C1010: unexpected end of file
while looking for precompiled header directive
mean ?, and how do I fix it ?
Thank you !... more >>
What is the best case for accessing managed code from unmanaged code?
Posted by Bae,Hyun-jik at 7/28/2005 12:00:00 AM
Hi,
What is the best case for accessing managed code from unmanaged C++ code,
considering that the unmanaged code doesn't have managed extension?
Please reply.
Thanks in advance.
Regards,
Hyun-jik Bae
... more >>
adding custom attributes?
Posted by Bae,Hyun-jik at 7/28/2005 12:00:00 AM
Hi,
Is there any way to add my own attribute to unmanaged C++ code? For example,
[MyOwnAttribute(id1,id2)]
int Foo(void* a,int b);
I searched for web and guess that attribute provider or something is related
to them, but I am not sure.
Please reply. Thanks in advance.
Regards,
Hyun-ji... more >>
unmanaged pointer to managed array
Posted by MR at 7/27/2005 12:26:04 PM
I am new to VS.C++ and am having a hard time when i have to share data
between managed and unmanaged code.
For example, I need to read binary data from a file and then call an non-CLR
dll function passing the data that was read as a void*
below is a snippet of the code that i have written in an ... more >>
VC++ 2005 Beta 2: warning C4490: 'override' : incorrect use of override specifier
Posted by Adriano Coser at 7/27/2005 11:01:48 AM
Hello.
After I converted my .net code to the new VC2005 syntax I started to get
C4490 on my ExpandableObjectConverter subclass overrides. The GetProperties
method is no longer called by the PropertyGrid when I use my subclass as a
type converter.
Can anyone tell me what has changed? What... more >>
MS compiler for AMD64 and the calling conventions
Posted by smarguer at 7/27/2005 7:22:04 AM
I am using Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40121 for
AMD64 to port a dll (C, C++ and fortran files) for WS2003. I am working with
VS2003, with customized paths in Tools > Options > Project > VC++ Directories
in order to correctly target the compiler executables and associ... more >>
using a function pointer in another function
Posted by AK at 7/27/2005 7:19:09 AM
I'm writing a Windows Forms application in C++.NET.
I've defined function F which takes 2 arguments a & b.
I need to use the pointer of F inside another function G & I can't
figure out how to do it properly.
Here's what I have :
U32 (*pf) (HANDLE, LPVOID); //declaring the function pointer
... more >>
How to convert managed char array to unmanaged char*?
Posted by joye at 7/27/2005 12:00:00 AM
Dear All,
Many old C standard library is useful for string operation such as strcpy.
But I meet some problem, a managed char array which declared in a structure
and this structure has a instance declared in a__gc class.
Sample code as following,
namespace Configure
{
using namespace Syste... more >>
Template specialization and partial specialization
Posted by Alfonso Morra at 7/27/2005 12:00:00 AM
Does VC 7.1 support template specialization and partial specialization ?
... more >>
strange pointer behavior
Posted by Bruno van Dooren at 7/26/2005 8:21:55 PM
Hi All,
i have some (3) different weird pointer problems that have me stumped. i
suspect that the compiler behavior is correct because gcc shows the same
results.
----------------------------------------------
//example 1:
typedef int t_Array[10];
int _tmain(int argc, _TCHAR* argv[])
{... more >>
Wrapper for unmanaged virtual methods probs
Posted by Carl at 7/26/2005 1:47:03 PM
Hello,
I noticed an unexplained (for me) behaviour while wrapping unmanaged virtual
methods.
This is the test situation:
An unmanaged class has four methods defined DoIt1 .. DoIt4. Each method just
returns false.
DoIt3 and DoIt4 are virtual methods defined in the base class MyBase of ... more >>
Code snipped crashes VS - why?
Posted by Chris Stankevitz at 7/26/2005 12:48:26 PM
You guys are going to like this. I work on a very large (500,000 line)
native C++ project. VS started crasing recently and I've similified it down
to fifty lines (took me six hours).
Why is the debugger crashing?
Microsoft Visual C++ .NET 69462-270-0000007-18536
Steps to reproduce:
... more >>
trying to insert my own icon into a Windows Forms application
Posted by AK at 7/26/2005 6:32:02 AM
I have a Windows Forms.NET project & am modifying the GUI in Form1.h[Design] .
I click the Form, go to Properties, click the Icon Property, & change it to
the .ico file I want. It accepts the change & shows me a thumbnail of the
image in the Properties tab, but when I compile I get a "C2039: 'G... more >>
Passing by Reference between C++ and C# using VS.NET 2005 Beta 2
Posted by Chris Mullins at 7/25/2005 10:12:15 PM
I've got a C++ DLL that I'm trying to pass a value type into by reference.
My C++ class looks like:
public ref class Class1
{
public:
System::Boolean DoSomething(System::Boolean &b)
{
b = !b;
return True;
}
};
My C# code (that won't compile) looks like:
B... more >>
Using C types with garbage collection
Posted by Gary Nastrasio at 7/25/2005 8:45:44 PM
Is it possible to use "normal" C types with garbage collection? Here's
the function I'd like to write, but not have to worry about deallocation:
char* ConvertStringToChar(String* pString)
{
const wchar_t __pin *pStrChars;
char* pOutString = (char*)malloc(sizeof(char) * 256);... more >>
class template
Posted by rich at 7/25/2005 3:36:04 PM
Hi there,
I defined a class template (MyClass) and some member variables and
functions, as following:
template<class T1, class T2>
class MyClass
{
...
struct m_variable
{
...
};
m_variable* MyFunc(m_variable* pv1, m_variable* pv2);
...
}
template <... more >>
__declspec(dllexport) to return char but errors in VB6
Posted by Jason W at 7/25/2005 3:10:15 PM
I have a C# class that I wan't to be able to use in VB6 and VBA
applications. To do this I was trying to use a mixed managed VC++ dll and
export a function. Doing this I get an error "The memory could not be
"read"".
Can any one explain what I am doing wrong?
This is my Code.
..CPP
... more >>
Question about proper garbage collection
Posted by the.newsletter NO[at]SPAM gmx.net at 7/25/2005 8:11:10 AM
Hello,
I'm not quite sure if all objects in my code are released properly by
the garbage collector, because under some circumstances (I didn't
figure them out yet) I encounter sometimes a
System.OutOfMemoryException.
It would be nice if someone of you could tell me if all the memory is
fre... more >>
Pointer to a generic class or structure
Posted by Dodo Cibelli at 7/25/2005 7:32:01 AM
Hello
I'd like to write a Generic class that use a pointer to the generic structure.
I can't do this
unsafe public class PClass<S> where S : new()
{
public S* pData;
public PClass( )
{
pData = (S*) .....
}
}
Nor
public class P... more >>
CDatabase error
Posted by <---> at 7/25/2005 12:00:00 AM
Dear All,
I am trying to use CDatabase class and include the class <afxdb.h>, but the
following error occurs,
Linking...
nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator
new(unsigned int)" (??2@YAPAXI@Z) already defined in libcpd.lib(newop.obj)
nafxcwd.lib(thrdcore.obj) : ... more >>
templates and inheritance
Posted by Greg Warren at 7/24/2005 2:59:01 PM
I am writing a container class so that I can reuse my double ended list
code. I have a base class CListBase that handles inserts and deletes with a
member function addItem, defined as:
template<class T>
class CListBase
{
CListBase<T>::CListBase();
virtual CListBase<T>::~CLis... more >>
store lots of data?
Posted by iwdu15 at 7/23/2005 2:35:03 PM
quick question for anyone who can help...im trying to mak a program that will
take an entered username and store a list of teams they chose from a list and
save that, to be called later. does anybody kno what i should save this list
as? thanks... more >>
[!! RANT !!] This is a hack at best (C4251)
Posted by Alfonso Morra at 7/23/2005 10:19:37 AM
I cannot believe how convoluted it is to export function templates and
class templates from a shared library (or DLL as it is called in the
Windoze world).
Micro$oft support for STL and standards in general is absolutely
appaling. This is absolutely ridiculous. I have obtaind links from
p... more >>
VC dialogs & XP themes
Posted by Egbert Nierop (MVP for IIS) at 7/23/2005 12:00:00 AM
When I build some add-ins for the management console using C++, the add-ins
made by me show a Win2000 interface while the rest of the add-ins made by MS
are using XP themes.
What am I missing?
Cheers
... more >>
FormatMessage and va_list args
Posted by Egbert Nierop (MVP for IIS) at 7/23/2005 12:00:00 AM
Hi,
I have a function that has a variable no of arguments
(note! function shortened)
myfunction(int someID, ...)
{
va_list args;
va_start args, someID;
FormatMessage(......, &args);
va_end(args);
}
PROBLEM: formatMessage wants a pointer thus, 'va_list *Arguments... more >>
How to eliminate assignment operator generation warning
Posted by tron.thomas NO[at]SPAM verizon.net at 7/22/2005 9:23:11 PM
I'm using Microsoft Development Environment 2002 Version 7.0.9466 on
Windows XP Professional Service Pack 2. If I compile the following
code at maximum warning level:
#include <functional>
class SetValue : public std::unary_function<int, void>
{
public:
explicit SetValue(int& value) : m... more >>
Calling managed function from unmanaged function in mixed mode dll
Posted by slugster NO[at]SPAM gmail.com at 7/22/2005 9:02:38 PM
Hi,
i originally posted this via another portal, but after giving it time
to propagate it still hasn't shown up. My apologies for the
multiposting.
This might be a very simple question, but i am still getting my head
round this stuff.
I have a mixed mode dll. In it i have a managed class w... more >>
how to Call VB dlll in VC
Posted by Al at 7/22/2005 2:25:10 PM
Could anybody point me to some resource about how to call a VB.net DLL in
VC.net?
Thanks in advance.
Al
... more >>
Debugging Unmanaged DLL With C# GUI .exe From VCPP 2003 Standard
Posted by Mark Jerde at 7/22/2005 3:09:03 AM
I googled and found a half-dozen good threads on debugging C# / VCPP on a
machine with both tools installed. But my co-worker and I haven't figured
out how she can debug her C++ code on her computer when her DLL is called
from my C# GUI .exe program. I have the full MSDN Universal toolset, b... more >>
Need tip about a warning message !
Posted by Marty at 7/22/2005 12:00:00 AM
Hi,
I would like to have a tip about this kind of warning, what should I do
get rid of that warning?
LINK : warning LNK4243: DLL containing objects compiled with /clr is not
linked with /NOENTRY; image may not run correctly
The project is a .NET C++ DLL in managed code.
Thanks a lot!... more >>
how to include a lib?
Posted by <---> at 7/22/2005 12:00:00 AM
dear all,
i have two .lib files, but i dunno how to include in my compilation in
vc.NET...
also, is there anyone has used IBM MQ before? i dunno how to connect all its
library... dunno why
worldman~
... more >>
what's wrong with my program?
Posted by Jason Felix at 7/22/2005 12:00:00 AM
#include<iostream>
#include<cstring>
using namespace std;
void quicksort(char *num,int len);
void qs(char *num,int left,int right);
int main()
{
char num[]="3,7,3,6,7,9,5,4,1,7,8,90,5,334,54,213,78";
cout<<"Original: "<<num<<"\n";
cout<<"sorting......"<<"\n";
quicksort(num,nu... more >>
How to send large chunks of memory from UMC to C# via MC++?
Posted by Sam Carleton at 7/21/2005 10:39:25 PM
I am looking for advice on best practices. I am coding against a
digital camera SDK. One of the callback functions returns the
large, multi megabyte images in smaller chunks. Some of the
images will be JPG, others will be RAW.
GUI is C#
Middle layer: MC++
Digital Camera SDK: UMC SDK
... more >>
HEEELLLLPPPP! Breakpoints in assembler code just stopped working
Posted by mclagett at 7/21/2005 6:49:07 PM
Can anyone please help me figure out why all of a sudden (even after many
restarts of Visual Studio 2005 and reboots, etc) I am no longer able to set
breakpoints in the disassembler window. I should mention that this is
assembler code I generate by writing opcodes to memory, but for a month o... more >>
Working Directory
Posted by Gary Nastrasio at 7/21/2005 5:44:57 PM
I'm using the OpenFileDialog class in my application and this changes my
current working directory (cwd) when a user selects a file to open.
Using MC++, how can I store my cwd into a String and then restore it
after the call to OpenFileDialog?
Thanks,
Gary... more >>
|