|
That's the whole point of shared memory. 2 applications that use the same memory.
So, by definition, the addresses MUST correspond. Otherwise it's no longer shared memory.
ex.
Using the first instance, we put an integer on address 666. Now, if we want to read that integer with the second instance, we need to know the address. In my case here, on win98 the address for the second instance is 666, but on winNT it is 1024 and so it doesn't refer to the same integer.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Grote Smurf (aka frisco) wrote:
So, by definition, the addresses MUST correspond. Otherwise it's no longer shared memory
Not at all. One process may get base address equal to 1000, another to 2000. If process 2 sets the address 2010 to 55, then first one will see 55 at 1010. Virtual memory, you know
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Ok, understood. So, linked lists are not an option here (what was I thinking, pressure).
But we can have an array of objects starting at a base-address. That's right, isn't it? So all I have to do is count from the address lpMapAddress to access all the objects.
Bassicly, I've been programming in java for several years, neglecting c for quite a while. I forgot that you can't assume anything in c++ . It's just a coincidence that the win98 returns the same address.
carry on...
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Grote Smurf (aka frisco) wrote:
linked lists are not an option here (what was I thinking, pressure).
Don't think so. Instead of pointers, use offsets. To create a real pointer, add offset to base address.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
You're right, but it seems easier to have something like pMyPointer++.
It doesn't have to be speedy, you know.
Nevertheless, this is just for a testcase. Next week, I'll start implementing this in our app, then I'm going to do the linked list for sure.
tnx again!
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Grote Smurf (aka frisco) wrote:
You're right, but it seems easier to have something like pMyPointer++.
There's nothing which could stop you from implementing smart pointer class. Providing operator++ would be trivial.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Smart pointers. I've already used them in a direct-x app, but never actualy created one.
Maybe I'll use it for the real thing next week. Now, an array's just fine
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Wrong! They use the same memory, yes. But they DO NOT have to map to the same memory address in your process. They share the same memory in the page file, but each process can obtain a different pointer. You are guaranteed that changing the memory in one changes it for the other, but beyond that nothing. This is by design, it's working as it should.
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
Grote Smurf (aka frisco) wrote:
lpMapAddress points to the same address on win98, but not on NT.
So what? It's not possible to guarentee that addresses in multiple memory spaces will be identical. You should store lpMapAddress outside the shared data section.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
I think you need to prepend global to your name
"Global\\XE_MEMORY_MAP"
if I remeber correctly.
Todd Smith
|
|
|
|
|
Hello,
I'm getting compile errors
error C2146: syntax error : missing ';' before identifier 'm_pConnection'
error C2501: '_ConnectionPtr' : missing storage-class or type specifiers
error C2501: 'm_pConnection' : missing storage-class or type specifiers
I used the Add Memeber Variable menu to create the variable. I'm not quite sure what is causing this. Any help
would be much appreciated.
Thanks
Karl
|
|
|
|
|
It doesn't know the type of variable m_pConnection is,
include the header file for the type.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Hello,
Thanks for the reply and I did check my source fill and I
found what I do believe is all the required header files
They are
#include "stdafx.h"
#include "PopulateDataGrid.h"
#include "PopulateDataGridDlg.h"
<br />
<br />
#if !defined(AFX_POPULATEDATAGRIDDLG_H__F98751E6_C09A_11D6_93C2_DF66D2E79326__INCLUDED_)<br />
#define AFX_POPULATEDATAGRIDDLG_H__F98751E6_C09A_11D6_93C2_DF66D2E79326__INCLUDED_<br />
<br />
#if _MSC_VER > 1000<br />
#pragma once<br />
#endif // _MSC_VER > 1000<br />
<br />
<br />
class CPopulateDataGridDlg : public CDialog<br />
{<br />
public:<br />
_ConnectionPtr m_pConnection;<br />
CPopulateDataGridDlg(CWnd* pParent = NULL);
<br />
enum { IDD = IDD_POPULATEDATAGRID_DIALOG };<br />
<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
protected:<br />
HICON m_hIcon;<br />
<br />
virtual BOOL OnInitDialog();<br />
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);<br />
afx_msg void OnPaint();<br />
afx_msg HCURSOR OnQueryDragIcon();<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
Thanks
Karl
|
|
|
|
|
So where is _ConnectionPtr defined?
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Hello,
If you look at my previous post you will see that it was
defined at "PopulateDataGridDlg.h" file.
Thanks
Karl
|
|
|
|
|
I'm assuming you are using
#import "C:\Program Files\Common Files\System\ADO\msado15.dll"
or some other similiar #import.
You need to make sure this line is before the call to #include "PopulateDataGridDlg.h"
Either that or your #import is specifing a namespace which you will need to prefix your _ConnectionPtr with.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
Hello Micheal,
Thanks for your reply and yes I did have the specified #import included. presently it is placed in "StdAfx.h" file
<br />
<br />
#if !defined(AFX_STDAFX_H__F98751E8_C09A_11D6_93C2_DF66D2E79326__INCLUDED_)<br />
#define AFX_STDAFX_H__F98751E8_C09A_11D6_93C2_DF66D2E79326__INCLUDED_<br />
<br />
#if _MSC_VER > 1000<br />
#pragma once<br />
#endif // _MSC_VER > 1000<br />
<br />
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers<br />
<br />
#include <afxwin.h>
#include <afxext.h>
#include <afxdisp.h>
#include <afxdtctl.h>
#ifndef _AFX_NO_AFXCMN_SUPPORT<br />
#include <afxcmn.h>
#endif // _AFX_NO_AFXCMN_SUPPORT<br />
<br />
#undef EOF<br />
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" rename_namespace("ADO20") <br />
<br />
#endif // !defined(AFX_STDAFX_H__F98751E8_C09A_11D6_93C2_DF66D2E79326__INCLUDED_)<br />
|
|
|
|
|
kiekar wrote:
import "C:\Program Files\Common Files\System\ADO\msado15.dll" rename_namespace("ADO20")
There is your problem. Why are renaming the namespace? Change the call to
#import "C:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename( "EOF", "adoEOF" )
|
|
|
|
|
Hello John,
Thanks for your reply, and yes you were correct. Your suggestion worked. I had got the import version from Microsoft Knowlege Base Article Q166112.
Thanks
Karl
|
|
|
|
|
I am using MIME encoding to send an HTML message with an 64 base encode jpg. When printing this message from Outlook, the text prints OK but the image does not print at all.
The only possible explanation I have found for this is the folowing Microsoft article:
Microsoft Knowledge Base Article - Q271562
HTML Messages with Pictures Do Not Print Correctly After You Install Internet Explorer 5.5 SP1 or 6.0.
However the Outlook patch meant to fix this problem adds all sorts of anoying security features to outlook, which cannot be undone without messing around with the registry. I'm a junior programmer at my company and do not really want to go and mess around with the directors' registries, without beeing sure if the above would even fix the problem.
Has anyone else encountered this problem? And is there a simple solution?
Man follows the way of earth. Earth follows the way of heaven.
Heaven follows the way of Tao. Tao follows what is natural.
|
|
|
|
|
Dear sir
please help me to install the oem.inf file for oem device .in vanila win98 SE
system , i tried lot of options like
1.RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection myoem.mydev 128 C:\\myDriver\\Win98\\myoem1.INF
2.rundll.exe setupx.dll,InstallHinfSection myoem.mydev 128 C:\\myDriver\\Win98\\myoem1.INF
this command is copy in files in the c:\windows\system\drivers folder and iosubsys folder but the registery is note updated
but this myoem1.INF is working fine with New hardware wizard
the win 2000 version of myoem1.INF is worked fine with 2000 win
using setup api SetupCopyOEMInf
but it IS NOT WORKING IN win98
SetupDiOpenClassRegKey
SetupInstallFromInfSection
is not working with win98 and me
is there is any api for win98 to execute the WDM INF file
or any other way without using the Wizard please tell me
how to do it using win SDK or DDK
|
|
|
|
|
I have a design issue.
I need a place where i can store a list of files that is per user, persistant for each run of the application and available on NT aswell as Win98/95 etc..
Ideally I would like a directory where i can store shortcuts to the files.
I'm developing on Win2K and I have a directory called
D:\Documents and Settings\Asim Hussain
1) Is there a function where I can get this directory like ::GetSystemDirecory?
2) Will this work cross platform, i.e. Win98 (*ughh* -- Shivers down my spine), will it still give me a valid directory considering that its single user etc...
I could just stick it all in the registry, but using shortcuts will save me a lot of time in displaying these files since all i will have to do is show the directory in a ShellView.
Cheers
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
SHGetSpecialFolderLocation with CSIDL_PERSONAL.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Cheers,
I should have known that.. must be my cold.
BTW: Klaus Schulze is quite good.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
I've created an mfc-dll on a win98/2 and it works fine, but on winNT/2000 "sometimes" it crashes.
Are there any platform-rules I have to take into account when building the dll, so it can be run on winNT?
tnx.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|