15,792,440 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Python questions
View PHP questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by hans.sch (Top 13 by date)
hans.sch
12-Sep-23 12:50pm
View
@Phil J Pearson - arg_dummy is an empty array which corresponds to the empty parameter list. If I remove it, the compiler complains because Invoke requires 2 parameters. The second parameter to Invoke is of type 'object?[]?'. And in fact arg_dummy is null because I don't assign it a value.
hans.sch
22-Aug-23 8:51am
View
@Maxim, thank you for your reply!
The line `IntCallback^ callback = gcnew IntCallback(MyCallback);` generates compiler error C3352: 'int (__cdecl *__cdecl cb)(int)': the specified function does not match the delegate type 'int (int)'. It only compiles when I declare 'int (__clrcall MyCallback)(int)' but when I do that, I have to propagate the __clrcall attribute into native code, and would have to compile the native code with /clr which may or may not work, but which I don't want to do for reasons beyond this discussion.
hans.sch
24-Dec-22 13:40pm
View
Thank you for the explanation! "can't specialize by number of template arguments" did surprise me. With your trick I can continue to explore templates. Just found that with a "requires" clause you can even specialize on the value of the template arguments :-) But I'll leave that for a later post.
hans.sch
12-Apr-15 2:38am
View
This is not about inverting a bit pattern, rather it is about learning about templates. In the long run, other stuff will take the place of bit inversion. My question is not whether it makes sense (I agree it doesn't) but whether it can be done.
I want to write a template implementation that does 'A' for for all types, except for a certain category of types (categorized by IsSuitableType<t>::value) for which it does 'B' - but 'B' won't compile for non-suitable types. 'A' could be an empty function body (if it were not that the function must return a value).
hans.sch
11-Apr-15 12:35pm
View
Thanks Philippe for the quick reply. The issue is that I don't want a compiler error when using an inadequate type but I want the 'dummy' implementation be used. The background is that the call to Invert goes into a template function, and for inadequate types, it simply doesn't get called, so I don't care about the return value. All I need is that it compiles error free.
To see the compiler error in the sample, add the dummy implementation above the specialized one.
I know the 'dummy' code won't compile if T::T() is not public, but I'll deal with this later...
hans.sch
20-Sep-12 11:09am
View
Thanks for the quick reply. Since I want to write a string to the edit that is not contained in the list, CB_SELECTSTRING is not an option.
Quoting from MSDN at http://msdn.microsoft.com/en-us/library/windows/desktop/ms632644%28v=vs.85%29.aspx: "For a combo box, the text is the contents of the edit-control portion of the combo box."
I may have to explicitly find the edit-control portion... I'll try that tomorrow.
Update: I retrieved the handle of the edit control of the combo box (used Spy++ to make sure this is what I want) and sent the WM_SETTEXT directly to the edit. It doesn't help: The string that is displayed is always one from the list.
hans.sch
20-Sep-12 11:06am
View
Thank you for the quick reply. The DropDownList style doesn't solve my problem because it doesn't allow the user to type a string that is not contained in the dropdown list. And, of course, it doesn't let me set such a string via WM_SETTEXT.
hans.sch
19-Jul-11 2:07am
View
Look up the topic "minidump" in the Visual Studio help system. I came across this topic recently, so there is no advice I can give except to read the documents.
hans.sch
19-Jul-11 2:00am
View
Karsten, I agree with you but my boss doesn't, so I'll have to stick to what we have (or we don't have, as far as the installer is concerned) :-(
hans.sch
13-Jul-11 9:02am
View
This is quite a good idea. I am using connection points, so I can call IDispatch::GetIDsOfNames. When the function returns something that is neither S_OK nor DISP_E_UNKNOWNNAME, I assume the client is dead, and I call my cleanup code. But how do I clean up the server-side COM object? I tried calling Release() but it didn't delete the object because the refcount was still 4, and I tried to delete it (using the 'delete' operator) but then I get an access violation when WinMain calls CoUninitialize before it exits.
hans.sch
13-Jul-11 6:21am
View
A "connection" is established by a call to CoCreateInstanceEx(). When I close down the connection (this happens when I assign 0 to the CComPtr - calls Release() behind the scenes) the server knows one client has said goodbye, and when the last client is gone, the server process terminates. Unfortunately this doesn't happen when the client crashes.
hans.sch
20-May-11 5:20am
View
I get your point. However junking MFC is no option. I have to follow company guidelines, and besides, our code base makes heavy use of MFC. No, I must do with CDialog, CWinApp, etc.
hans.sch
19-May-11 8:32am
View
Maybe it is disabled by your company's policies? Ask your network admin.
Show More