|
Hi, all,
I built a C++ dll which contains functions accessing database using OLEDB. I try to load the dll functions from Access VBA. I can successfully execute non-db functions in the dll. I can also successfully execute open/close connections to db functions. But I have troubles to open a recordset with a sql statement after open the connection to db. Everytime it gives several error messages saying "The instruction at xxxx referenced memory at xxxx. The memory could not be read". Does anyone has any idea what may cause this? Or does anyone has a successful example?
Thanks!
|
|
|
|
|
Hello,
I just finished a project of mine. Since I like the result, I would like to build the functionality into Visual Studio 6.0.
I searched the internet (codeproject, codeguru, msdn and google), but I found no relevant information.
If somebody might know an article, sdk or an other resource where I could find the information needed to build a com add-in, please link me to that information.
Thanks in advance.
|
|
|
|
|
Hi !
Does everyone know any good articles about how brute force works and how to realize it in C++ ?
MFG
RedDragon
Unix and C are the ultimate computer viruses.
Visit me: www.programming.info.ms
|
|
|
|
|
for (int i=0;i < maxKeySize;i++)
{
KeyType key(i);
if (Decrypt(data, key) == something_that_looks_like_plaintext)
{
all done.
break;
}
}
Software | Cleek
|
|
|
|
|
I want to create my own function like the Win32 API's, where you can use things like this: WS_VISBLE | WS_BORDER.
What opperator do I use to check for each style? and what variable type should I use? I'm guessing LONG or WORD
Winuser.h makes everything this way: #define SOMETHING 0x10000000L.
So if I want 14 Flags, what should I make each one?
while I'm asking about opperators, here is some code that always executes no matter what style (it seems)
LONG Style = 0;
if((Style = GetWindowLong(hwnd,GWL_STYLE)) != 0){
if(!(Style & BS_TEXT)) {
SetWindowLong(hwnd,GWL_STYLE,Style & ~BS_BITMAP); if((Style = GetWindowLong(hwnd,GWL_STYLE)) != 0) SetWindowLong(hwnd,GWL_STYLE,Style | BS_TEXT); }
}
wWw.KruncherInc.cOm
|
|
|
|
|
Um haha, how do I get my code to format right?
wWw.KruncherInc.cOm
|
|
|
|
|
KingKruncher wrote:
What opperator do I use to check for each style?
and: &
1. set up your flags so they each take only one bit:
<br />
#define BIT_ZERO_FLAG (1 << 0)<br />
#define BIT_ONE_FLAG (1 << 1)<br />
#define BIT_TWO_FLAG (1 << 2)<br />
2. to test a flag:
<br />
if ((flag & BIT_ONE_FLAG) == BIT_ONE_FLAG)<br />
{<br />
.. bit one was set ..<br />
}<br />
or, if you don't want to define constants:
<br />
#define IsBitSet(_data,_bitpos) (((_data) & (1 << _bitpos))==(1 << _bitpos))<br />
<br />
bool bBit5IsSet = IsBitSet(flags, 5);<br />
Software | Cleek
|
|
|
|
|
Why would you define such macros?
If you want to test for a flag wheter it is set or not, a simple & is enough.
<br />
#define FLAG1 0x0001<br />
#define FLAG2 0x0002<br />
#define FLAGn n<br />
<br />
if( flags & FLAG1 )<br />
{<br />
}<br />
<br />
if( (flags & FLAG2) == FLAG2 )<br />
This way, you'll save some CPU cycles and you can define more flags
|
|
|
|
|
Bob Stanneveld wrote:
Why would you define such macros?
because you might be looking at individual bits for purposes other than testing pre-defined flags. and, it helps reduce errors like this:
if (data & BIT_POSITION_VALUE == BIT_POSITION_VALUE)
{
...
}
if ((data & BIT_POSITION_VALUE) == BIT_POSITION_VALUE)
{
...
}
Bob Stanneveld wrote:
This way, you'll save some CPU cycles and you can define more flags
there's no CPU savings there (except perhaps a micro-second worth of compiler time), because the pre-processor will turn that macro into code identical to what you show.
Software | Cleek
|
|
|
|
|
http://www.codeproject.com/cpp/bitbashing.asp[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Hi guys,
I developed SDI project, but I'm hiding the form view and showing only dialogs, these dialogs dont have a taskbar icon, I dont know how to make it shows, can anyone help me please
|
|
|
|
|
Hello,
I've been learning MFC with 3 different books. I'm at the point where I understand most of the basics. So I'm trying to write an useful program using AppWizard (I get the concept behind the code). The problem is, the examples in my books only show really, really basic applications where there is only one screen to interact (like a calculator). I want my application to be able to show the user different interfaces depending on what state it is in. i.e., I want to show a screen for the user to enter info (like name, age, location, etc), and when the user clicks another button, I want to show a different screen (like a jpeg/bitmap/chart, etc)... I don't know how to implement that. I'm using SDI. I'm guessing I need to use MDI and show/hide screen accordingly? If that is the case, do I just call the showWindow function? Any advice, hints, and explanation is much appreciated!
Thanks
|
|
|
|
|
It sounds like you are wanting a tabbed dialog, or a CPropertySheet object.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
hello,
i want to make program ras api completely,
i mean, i'll make the dial up(DUN) and the response for the dial up
for the the dial up is not my problem.
the problem is how to handle incoming connection using ras api?
i want to call incoming connection dialog in the windows programmatically with visual C++ and i don't know.
i am using window 2000
please help me, if anyone knows to handle this.....
|
|
|
|
|
Does anyone know where I get a get a good animation of a spinning hour glass, or somthing that would look good while the user waits for some hardware communication to complete?
Joel Holdsworth
|
|
|
|
|
|
No, I'm thinking more along the lines of an animated icon control! - Like the flying piece of paper you get when you copy a file in Explorer.
Joel Holdsworth
|
|
|
|
|
Joel Holdsworth wrote:
Like the flying piece of paper you get when you copy a file in Explorer.
Look for FileCopy.avi in your C:\Program Files\Microsoft Visual Studio\Common\Graphics\Videos folder.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
I posted a question earlier about not being able to see my modal dialog when making a screensaver. I've modified the MFC sample 'SAVER' to show my dialog on LBUTTONDOWN or WM_MOUSEMOVE or the others. I can see the dialog now, but I can't interact with it. It shows up, but I can't click a button, click in the edit box or anything. Does anyone have any suggestions?
[insert witty comment here]
bdiamond
|
|
|
|
|
Hi,
I have a custom slider control derrived from CSliderCtrl. It basically overrides the appearance of the slider. However the dialog containing this slider does not receive any messages on horizontal (or vertical) scroll. When I insert other default sliders the function does get triggered so I don't think my message map is wrong. Any ideas?
I've considered adding my own message, however I'd like to understand and keep things more consistent. Can I post a WM_HSCROLL message manually when changes occur to this slider? How would I do that? And in general for buttons and sliders is it the object that posts the message to parent window or the windows system that sends the message to the button/slider object and it just happens to pass by the parent dialog first which you catch?
Thanks
|
|
|
|
|
May be of help:
http://www.codeproject.com/listctrl/synchscroll.asp
|
|
|
|
|
Problem: I need to create a Client/Server Application.
[Server] Winsock host, MS SQL 7/2000 connectivity. The server must accept multiple connections and return database query results in text/xml
help examples may have an access database.
[Client] Winsock Client, Convert text/xml data from server into recordset. These rescordset will be displayed on forms in an MDI environment on a Win32 platform
Current Status: I can create the above scenario in Visual Basic. I need to create it in Visaul C++ because I understand one has more control of winsock in C++.
I have tried to use VB-to-C++ converters this was no help
I have tries combining bits and pieces of samples from this site and the most successful was using NDK, DAO, ATL and Dialog based. Tried converting it to MDI then all hell broke lose.
Reason: I have and application developed in visual basic that uses the data environment connections, and reports using Seagate Crystal. This application run over a WAN/LAN (two cities) the connection is slow especially when trying to get a recordset
|
|
|
|
|
I'm modifying a directx sample (MOIRE.scr) screensaver. I'm making it where when the screensaver would usually end, it's popping up a dialog that I made. A company we do work for would like to have a screensaver running on machines for walk-ins that they allow to use their resources, but for statistical purposes they would like all users to log in. I need my dialog to show so that the user can log in if they're registered, or sign up if they're not. The problem is that when the screensaver stops, it just blanks out. If I hit ctrl+alt+delete to bring up the task manager, the taskbar is visible and I can see the dialog listed in the taskbar, it's just not visible. I've tried SetForegroundWindow, SetWindowPos, and SetFocus, but none of them seem to work. Can anyone help me with this problem?
[insert witty comment here]
bdiamond
|
|
|
|
|
I'm in the process of adding a separate thread for a certain type of processing done in an app which deals with very large files (sometimes more than 1GB), and can take several minutes. The app has been an ongoing project for the last several years, should have been done as a multi-threaded app to begin with, but I'm coming in a bit too late to think about that
Anyway, with a ton of help from searching around the message board here (thanks!) I've spawned the processing off to a different messaging thread, which has two messages it can respond to UWM_START and UWM_STOP. While processing, it responds back to the main thread with UWM_UPDATE_PROGRESS and then UWM_DONE_PROCESSING when finished. For the most part this works well. UWM_START kicks off the long processing and it periodically has a message pump loop it does so that if UWM_STOP is sent it can respond to it. This part is working well, but I'm having a problem with code that is shared between this thread and the main thread.
The part that is spawned off shares A LOT of code with the rest of the project, the shared code contains many message pumping loops (which are needed because of the fact it was done as single threaded to begin with). When I comment out thoes message pump loops (and leave the one in the processing thread), everything works great. However, if those message pump loops are in there, then I get a couple of weird errors. This doesn't really make sense though, since the documention of the message functions indicate it's done on a thread-by-thread basis, so I shouldn't be messing any of the messages up. ... and why would one pump be ok, and more cause problems?
My question is, are these extra message pump loops causing me problems, or are they just helping uncover some larger flaw with all the shared code?
BTW, the message pump loops are implemented as suggested in many places on the board:
MSG msg;<br />
while(::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)<br />
AfxGetThread()->PumpMessage();
-----
In the land of the blind the one eyed man is king.
|
|
|
|