159 Posted Topics

Member Avatar for Frederick2

Will an int in C/C++ now be 8 bytes instead of 4? printf("sizeof(int) = %u\n", sizeof(int)); sizeof(int) = 8 In DOS it was 2 afterrall. And what about doubles? Will they be 16 bytes? Maybe call them 'fourples'... I really don't know. Me and my employeer are stuck in 32 …

0
63
Member Avatar for Frederick2

Been studying what I thought was a fairly authoritative article about BSTRs by Bruce McKinney... [url]http://www.ecs.syr.edu/faculty/fawcett/handouts/cse775/Presentations/BruceMcKinneyPapers/COMstrings.htm[/url] where he states that the four bytes before the start of the BSTR contains the string's length. Here is the exact quote... [QUOTE] What Is a BSTR? The BSTR type is actually a typedef, …

Member Avatar for Frederick2
0
2K
Member Avatar for Frederick2

This is one mean function! I've tried everything I can think of. I registered a type library with LoadTypeLibEx() which is a really easy function to use. I mistakingly thought UnregisterTypeLib() would be routine. Its most decidedly not! The error I keep getting with FormatMessage() is... Error accessing the OLE …

Member Avatar for Frederick2
0
514
Member Avatar for Kyle Wiering

When you click a button, the focus will change to the button (the button will have keyboard focus). Therefore, any keypresses will be sent to the window procedure of the button, which is in user32.dll I believe. So, you might try using a SetFocus() call back to your main window …

Member Avatar for Frederick2
0
446
Member Avatar for cruisx

Use the GetModuleFilename() Api function to get the aformentioned into a buffer and parse it for the path. Then do what you want with it.

Member Avatar for Frederick2
0
136
Member Avatar for Nicholas_Roge

The reason you are not getting any replies Nicholas is because what you are trying to do isn't doable.

Member Avatar for Stefano Mtangoo
0
113
Member Avatar for aallan

[QUOTE] Its executables are also small [/QUOTE] What do you mean by small? A year ago I downloaded a wxWidgets demo that had a few GUI elements on it (buttons, listboxes, etc.) and it was around 800K or something like that. A Win32 Sdk style program like that would have …

Member Avatar for Stefano Mtangoo
0
437
Member Avatar for Frederick2

Recently I've been looking into BSTRs, and have found how 'touchy' they can be. I saw this in a COM class in the class destructor regarding a m_strBStr member... [CODE] if(m_strBStr) SysFreeString(m_strBStr); [/CODE] When I saw it I thought, "How would the BSTR have a zero assigned to it?", because …

Member Avatar for Fbody
0
148
Member Avatar for data4use

I'd be really leery of returning a stack based temporary variable to a caller as you are doing.

Member Avatar for data4use
1
151
Member Avatar for nocloud

I still do a lot of stuff as in C instead of C++, and things like you are doing is one of them. So here's my C solution. You won't hurt my feelings if you don't want it. [CODE=C++] #include <stdlib.h> #include <stdio.h> /* Data Looks Like This... 19700326.15 71.37 …

Member Avatar for Frederick2
0
592
Member Avatar for IDSTECH

Maybe its just me, but that strikes me as a strange thing to do. Far easier to just put a text box on a form at design time, and retrieve data out of it if the user enters any.

Member Avatar for IDSTECH
0
88
Member Avatar for esdftw

That's confusing looking data. Does every line have the same structure (even though the data is different) with the same number of delimiters? I'm seeing pipe characters which you mentioned were being used as delimiters, but I'm also seeing commas.

Member Avatar for esdftw
0
156
Member Avatar for Nicholas_Roge

Just to see what happens, why don't you try a fully qualified path? With constructs such as you are using, its usually GetProcAddress() that causes trouble - not LoadLibrary().

Member Avatar for Ancient Dragon
0
157
Member Avatar for n.utiu

I have VS 2008 Pro but tend to use CodeBlocks for C++. Like all Microsoft software, VS has a very 'heavy' and 'slow' feel to it, i.e., massive gigabytes in installation, lots of hourglasses, slow to react, etc. I tend to use older equipment than most, so perhaps its not …

Member Avatar for abdelhakeem
0
91
Member Avatar for Clawsy

The invalid region is contained within the RECT member (.rcPaint) of the PAINTSTRUCT you used as an output parameter in the BeginPaint() call. It can be easily retrieved from there. I wrote the above without looking at your code. All your code is totally bad. You are using BeginPaint() incorrectly. …

Member Avatar for Clawsy
0
1K
Member Avatar for justinclev

Might be something useful to you here... [url]http://www.jose.it-berater.org/smfforum/index.php?board=380.0[/url] Starting around ProgEx13 on up to #18 or 19 is a lot of stuff on dlls and mixed language programming with C++ - PowerBASIC and vice versa. [url]http://www.jose.it-berater.org/smfforum/index.php?topic=3335.0[/url] Lot of advanced WinApi and COM stuff at that site.

Member Avatar for Frederick2
1
128
Member Avatar for Frederick2

Does anyone know if there are any issues in using the basic ODBC Api for database access on 64 bit Windows Vista/7 systems? This has been my preferred database access technology for a long time, and I'd prefer not moving to ADO or something else if I don't have to. …

Member Avatar for Frederick2
0
160
Member Avatar for Frederick2

It seems even if I place #define _CRT_SECURE_NO_WARNINGS at the top of my C++ source files, if the warning level is set to 3 or 4 I still get all the warnings. Is this the way it is supposed to be? I like to have my warning levels set fairly …

Member Avatar for Frederick2
0
499
Member Avatar for Phil++

I feel your question is a bit vague, so I'm afraid my answer will necessarily also be vague. If your classes have nothing whatsoever to do with I/O then you'll need to change nothing. However, if any of them do console I/O, then you've got problems.

Member Avatar for Ancient Dragon
0
96
Member Avatar for nichya88

When you specify this to output... &say[0] it tells cout to start outputing text from the address of say[0] until it hits a null - hence you get 'Hello'. When you specify this to output... &say[1] it tells cout to start outputing text from the address of say[1] until it …

Member Avatar for nichya88
0
139
Member Avatar for itzshaheer

Some time ago I discovered that with both Microsoft Access and SQL Server the operating system, i.e., Windows, doesn't like databases anywhere at all in \Documents And Settings\... It might work if you put the .mdb file somewhere else.

Member Avatar for kvprajapati
0
169
Member Avatar for san_fran_crisko

I think Narue's idea is really good. I'd learn both. Old C books and tutorials in C are easy to find and inexpensive. Start 1 chapter at a time in each and you'll soon find that one reinforces the other.

Member Avatar for Narue
0
286
Member Avatar for Frederick2

This is my first VB.NET post as I'm mainly a C/C++ and PowerBASIC developer. I'm trying to figure out how to pass a struct like so as a function parameter to/from a C/C++ or PowerBASIC dll using PInvoke of course in VB.NET. The struct in C looks like this... [CODE=C++] …

0
62
Member Avatar for pac-man

Because today your luck is running good! All kidding aside, it just so happens that that address is still within your address space, so it isn't crashing. Add a few more lines of code and do it and your luck will likely run out! Doing that sort of thing will …

Member Avatar for pac-man
0
125
Member Avatar for Stevoni

I expect you should be able to call the functions in the dll from vb.net. As mentioned by the other helpful poster, you will need some kind of header file from the dll to see what the exported functions look like. Having seen that, you should be able to generate …

Member Avatar for Ancient Dragon
1
234
Member Avatar for CppBuilder2006

How any commercial compiler manufacturer implements the C++ keyword 'new' is likely proprietary information, I expect. GlobalAlloc is of course unique to Win32. Its a function callable from any language capable of calling external functions. I use it a lot in PowerBASIC. I also use it in C and C++. …

Member Avatar for CppBuilder2006
0
276
Member Avatar for eduard77
Member Avatar for Silvershaft

[QUOTE=Silvershaft;1088046]Hello I got a little problem with winapi programming I can edut dialogs graphically with resource editor but is there any way to edit mainform in similar way? Writing on iPod so there may be typos[/QUOTE] No.

Member Avatar for Ancient Dragon
0
77
Member Avatar for tkud

The code seems to have all the functionality within it for opening files. Have you tried opening a file that doesn't contain Chinese?

Member Avatar for Frederick2
0
920
Member Avatar for tkud

[QUOTE] Hey everyone, since nobody has decided to assist me in my problems, ... [/QUOTE] If I recall, a number of people tried to assist you in your problems, and I even provided a program for you to run so we could see what character set you were using. Correct …

Member Avatar for Frederick2
0
314
Member Avatar for kevintse

I spend about 50% to 60% of my time doing Windows CE and I just use the stdio.h functions for text output and I usually do the Api functions (CreateFile, SetFilePointer, etc.) for binary access. Here's an example of opening my DEBUG output file in one of my CE programs... …

Member Avatar for Frederick2
0
232
Member Avatar for Argo54325

Rajesh just gave you excellent advice. [QUOTE] Yes i actually came across that today, but its done in C. Is there one that is done in C++? [/QUOTE] You may not know this, but MFC is just an OOP wrapper on the C Win Api. No matter how much you …

Member Avatar for marco93
0
153
Member Avatar for samsons17

its not portable, but for windows works good... [CODE] #include <windows.h> #include <stdio.h> void cls(HANDLE hStdOutput) { COORD coordScreen = {0,0}; DWORD cCharsWritten; CONSOLE_SCREEN_BUFFER_INFO csbi; DWORD dwConSize; GetConsoleScreenBufferInfo(hStdOutput, &csbi); dwConSize = csbi.dwSize.X * csbi.dwSize.Y; FillConsoleOutputCharacter(hStdOutput,(TCHAR)' ',dwConSize,coordScreen,&cCharsWritten); GetConsoleScreenBufferInfo(hStdOutput,&csbi); FillConsoleOutputAttribute(hStdOutput,csbi.wAttributes,dwConSize, coordScreen,&cCharsWritten); SetConsoleCursorPosition(hStdOutput,coordScreen); } int main(void) { HANDLE hStdOutput; puts("Hello, World!"); hStdOutput=GetStdHandle(STD_OUTPUT_HANDLE); puts(" …

Member Avatar for DarkC0de
0
142
Member Avatar for etteragram

[QUOTE=etteragram;1081253]can you help me do a program using array in c++. 1. accepts 10 input numbers and output its sum and average. 2.accepts 10 input numbers and arrange it from highest to lowest. 3. accepts 10 input numbers will output the highest number and lowest number. thank you.[/QUOTE] The rules …

Member Avatar for Frederick2
-1
100
Member Avatar for Stefano Mtangoo

I really like CodeBlocks with Visual Studio 2008 coming in a close second. I'm with Narue on the class frameworks... [QUOTE] >2. What is your favorite GUI library I equally dislike all of the ones I've tried. [/QUOTE] ...except that I think I hate MFC worst of all. For Windows …

Member Avatar for Lawand
0
139
Member Avatar for Stefano Mtangoo

[QUOTE=evstevemd;1076283]I see alot of libraries written in C and I like C++ OOP way. How can I use a given C library functions in C++?[/QUOTE] I don't understand your question. All you need to do is include the header file and perhaps link with the library if its something unusual …

Member Avatar for Stefano Mtangoo
0
176
Member Avatar for ali8888

[QUOTE] How create win32 application in Microsoft Visual Studio 2008 ?? I do not want to select " Empty project " [/QUOTE] "Empty Project" is good. That's how I start all my VS projects. Of course, you have to know what to do next...

Member Avatar for ali8888
0
171
Member Avatar for xman13157

yaaa gotta make variables, then use ifs and loops is ther anythn else ya gotta know?

Member Avatar for zobadof
-7
105
Member Avatar for Frederick2

[CODE=C++] /* I'm stuck! Here is what I consider to be a perfectly running program that uses an array ( TArray ) template to hold arrays of objects. Its just about your classic text book example. Its pretty well stripped down to nothing to illustrate my problem. I simply don't …

Member Avatar for Frederick2
0
199
Member Avatar for ihatestarch

A Copy Constructor has to completely generate a new Person object with the Person object passed as a parameter. Apparently one of the members of this Person object is a pointer to a struct/class that probably looks something like this... [CODE=C++] class Date { public: void set_year(short year); void set_month(short …

Member Avatar for ihatestarch
0
79
Member Avatar for mohammad1982

Sometimes Dev-C++ 'sticks' and fails to save and utilize changes when you edit something. I oftentimes do a 'Clean' from the compile menu which deletes the existing binaries so it forces the IDE to generate new ones. By all means you should include all the files in your project through …

Member Avatar for Frederick2
0
113
Member Avatar for CodyOebel

Hi Cody! I didn't run your 2nd program but was able to compile the first one you seem to be having troubles with. I used the Dev-C++ development suite. However, I had to comment out this line because I didn't have the icon file which you apparently have... //IDI_MYICON ICON …

Member Avatar for CodyOebel
0
147
Member Avatar for zobadof

I just recently posted some tutorials here... [url]http://www.jose.it-berater.org/smfforum/index.php?topic=3389.0[/url] Lot of stuff having to do with pointers, message crackers, etc. If you are into graphics at the Api level you should probably think about Charles Petzold's Programming Windows book. He is heavy into graphics. I can't really speak to other class …

Member Avatar for SgtMe
0
181
Member Avatar for coldkiller

[QUOTE] nor are there any native MS-DOS assembly language system calls that support the mouse. [/QUOTE] The int 33h interrupts were used for that, but I doubt the user is interested in those. In any case, I don't believe I've ever tried to move the mouse cursor. Usually, one wants …

Member Avatar for Frederick2
0
322
Member Avatar for ababhijit das

Here's all of it... [CODE] #ifndef _FILE_DEFINED struct _iobuf { char *_ptr; int _cnt; char *_base; int _flag; int _file; int _charbuf; int _bufsiz; char *_tmpfname; }; typedef struct _iobuf FILE; #define _FILE_DEFINED #endif [/CODE]

Member Avatar for Narue
0
101
Member Avatar for veroniclake

I'm pretty sure its line 273 that is causing the problem. (The Microsoft documentation is right. There is something wrong in your code. But how can anyone help with the limited information you provided?)

Member Avatar for Frederick2
0
118
Member Avatar for Silvershaft

Anything you use other than the Win32 Api for Windows programming involves your use of the Win32 Api through an 'abstraction layer'. That abstraction layer might be MFC, it might be .NET. It might be wxWidgets or QT. In other words, you are making a trade off in the hope …

Member Avatar for William Hemsworth
0
159
Member Avatar for epicasian

For PC desktop programming I use PowerBASIC from [url]www.powerbasic.com[/url]. For Windows CE I use C++, mostly because I don't have much choice. For both languages I use pointers extensively; both in PowerBASIC and C++. They are critical; however, until you become fairly advanced their need pretty much is hard to …

Member Avatar for Frederick2
0
252
Member Avatar for Stefano Mtangoo

I'll tell you my opinion with the stress on OPINION. There is no easy way out. That's what everyone is looking for. MFC will make it easier (3 months later). UMMM. This is getting confusing. UMMM. Maybe .NET will make it easier (6 months later and still 4 gigabytes of …

Member Avatar for Stefano Mtangoo
1
214
Member Avatar for AdRock

AdRock, Post some code in code tags. I don't think anybody wants to look at what you posted. Preferably short. Can you get a Hello, Woirld to compile in Linux?

Member Avatar for AdRock
0
177

The End.