- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在 Netbeans 中制作一个简单的 JavaSE 登录 jFrame。我创建了一个内部 sql 数据库,但问题是启动应用程序时它具有以下控制台输出:
run:
CONNECTION DONE!
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.apache.derby.client.net.NetConnection40 cannot be cast to com.mysql.jdbc.Connection
at DBConnection.connect(DBConnection.java:31)
at mainFrame.<init>(mainFrame.java:29)
at mainFrame$7.run(mainFrame.java:360)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
BUILD SUCCESSFUL (total time: 1 second)
它说连接已完成,但随后出现错误。我还在库中导入了 derbyclient.jar 文件。我在网上搜索了解决方案并尝试替换:
jdbc:derby://localhost:1527/JavaDB;
这样:
jdbc:derby://localhost:1527/JavaDB;create=true
代码:主框架
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.sql.ResultSet;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author sniper
*/
public class mainFrame extends javax.swing.JFrame {
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); // Getting dimentions for screen size
int xMouse; // for movement x axis
int yMouse; // for movement y axis
// FOR SQL CONNECTION
Connection conn = new DBConnection().connect();
/**
* Creates new form mainFrame
*/
public mainFrame() {
initComponents();
this.setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2); // setting screen in center
txtUsername.setHorizontalAlignment(SwingConstants.CENTER); // center align txtUsername text
txtPassword.setHorizontalAlignment(SwingConstants.CENTER); // center align txtPassword text
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
lblHeaderText = new javax.swing.JLabel();
txtUsername = new javax.swing.JTextField();
txtPassword = new javax.swing.JPasswordField();
lblLoginTypeText = new javax.swing.JLabel();
cbType = new javax.swing.JComboBox<>();
btnEnter = new javax.swing.JLabel();
lblTopText = new javax.swing.JLabel();
lblIcon = new javax.swing.JLabel();
lblExit = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("SGMS");
setUndecorated(true);
setResizable(false);
jPanel1.setBackground(new java.awt.Color(0, 0, 0));
jPanel1.setForeground(new java.awt.Color(255, 255, 255));
jPanel1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
public void mouseDragged(java.awt.event.MouseEvent evt) {
jPanel1MouseDragged(evt);
}
});
jPanel1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
jPanel1MousePressed(evt);
}
});
jPanel2.setBackground(new java.awt.Color(0, 51, 51));
jPanel2.setForeground(new java.awt.Color(153, 204, 255));
lblHeaderText.setBackground(new java.awt.Color(0, 51, 51));
lblHeaderText.setFont(new java.awt.Font("Arial Black", 1, 36)); // NOI18N
lblHeaderText.setForeground(new java.awt.Color(102, 102, 255));
lblHeaderText.setText("SGMS - LOGIN");
txtUsername.setBackground(new java.awt.Color(0, 0, 0));
txtUsername.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
txtUsername.setForeground(new java.awt.Color(255, 255, 255));
txtUsername.setText("Username");
txtUsername.setToolTipText("");
txtUsername.setBorder(null);
txtUsername.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
txtUsernameMouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
txtUsernameMouseExited(evt);
}
});
txtPassword.setBackground(new java.awt.Color(0, 0, 0));
txtPassword.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
txtPassword.setForeground(new java.awt.Color(255, 255, 255));
txtPassword.setText("Password");
txtPassword.setBorder(null);
txtPassword.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
txtPasswordMouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
txtPasswordMouseExited(evt);
}
});
lblLoginTypeText.setFont(new java.awt.Font("Arial Black", 0, 18)); // NOI18N
lblLoginTypeText.setForeground(new java.awt.Color(102, 204, 255));
lblLoginTypeText.setText("LOGIN TYPE");
cbType.setBackground(new java.awt.Color(0, 51, 51));
cbType.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "CHOOSE LOGIN TYPE", "Administrator", "Academic Staff", "Administrative Staff", "Student" }));
btnEnter.setIcon(new javax.swing.ImageIcon("C:\\Users\\sniper\\Documents\\NetBeansProjects\\SDMS\\enter.png")); // NOI18N
btnEnter.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btnEnter.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btnEnterMouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
btnEnterMouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
btnEnterMouseExited(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(66, 66, 66)
.addComponent(lblHeaderText)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(25, 25, 25)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtUsername, javax.swing.GroupLayout.DEFAULT_SIZE, 389, Short.MAX_VALUE)
.addComponent(txtPassword))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblLoginTypeText)
.addGap(86, 86, 86))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(104, 104, 104)
.addComponent(cbType, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(26, Short.MAX_VALUE))))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnEnter)
.addGap(256, 256, 256))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(34, 34, 34)
.addComponent(lblHeaderText)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtUsername, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblLoginTypeText))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cbType, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 87, Short.MAX_VALUE)
.addComponent(btnEnter, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(19, 19, 19))
);
lblTopText.setBackground(new java.awt.Color(0, 0, 0));
lblTopText.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
lblTopText.setForeground(new java.awt.Color(255, 255, 255));
lblTopText.setText("SGMS");
lblIcon.setBackground(new java.awt.Color(51, 51, 255));
lblIcon.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
lblIcon.setForeground(new java.awt.Color(255, 255, 51));
lblIcon.setIcon(new javax.swing.ImageIcon("C:\\Users\\sniper\\Documents\\NetBeansProjects\\SDMS\\logo.png")); // NOI18N
lblExit.setIcon(new javax.swing.ImageIcon("C:\\Users\\sniper\\Documents\\NetBeansProjects\\SDMS\\exit.png")); // NOI18N
lblExit.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
lblExit.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lblExitMouseClicked(evt);
}
public void mouseEntered(java.awt.event.MouseEvent evt) {
lblExitMouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
lblExitMouseExited(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(lblIcon)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblTopText)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblExit)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblTopText)
.addComponent(lblIcon)
.addComponent(lblExit))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>
private void lblExitMouseClicked(java.awt.event.MouseEvent evt) {
// EXIT BUTTON
System.exit(0);
}
private void lblExitMouseEntered(java.awt.event.MouseEvent evt) {
// MOUSEOVER ICON CHANGE
lblExit.setIcon(new ImageIcon("exit_hover.png"));
}
private void lblExitMouseExited(java.awt.event.MouseEvent evt) {
// MOUSE EXIT ICON CHANGE
lblExit.setIcon(new ImageIcon("exit.png"));
}
private void jPanel1MouseDragged(java.awt.event.MouseEvent evt) {
// FOR MOVEMENT OF JFRAME
int x = evt.getXOnScreen();
int y = evt.getYOnScreen();
this.setLocation(x - xMouse,y - yMouse);
}
private void jPanel1MousePressed(java.awt.event.MouseEvent evt) {
// Saving mouse to start from frames 0,0 position
xMouse = evt.getX();
yMouse = evt.getY();
}
private void txtUsernameMouseEntered(java.awt.event.MouseEvent evt) {
txtUsername.setBackground(Color.GRAY);
}
private void txtUsernameMouseExited(java.awt.event.MouseEvent evt) {
txtUsername.setBackground(Color.BLACK);
}
private void txtPasswordMouseEntered(java.awt.event.MouseEvent evt) {
txtPassword.setBackground(Color.GRAY);
}
private void txtPasswordMouseExited(java.awt.event.MouseEvent evt) {
txtPassword.setBackground(Color.BLACK);
}
private void btnEnterMouseEntered(java.awt.event.MouseEvent evt) {
// Setting Icon on hover
btnEnter.setIcon(new ImageIcon("enter_hover.png"));
}
private void btnEnterMouseExited(java.awt.event.MouseEvent evt) {
// Setting icon on hover off
btnEnter.setIcon(new ImageIcon("enter.png"));
}
private void btnEnterMouseClicked(java.awt.event.MouseEvent evt) {
// LOGIN CODE HERE
String sql = "select * from ROOT.ADMINLOGIN where username=? and password=?";
try
{
PreparedStatement ps = (PreparedStatement) conn.prepareStatement(sql);
ps.setString(1, txtUsername.getText());
ps.setString(2, txtPassword.getText());
ResultSet rs = ps.executeQuery();
if(rs.next())
{
JOptionPane.showMessageDialog(this,"SUCCESSFULL");
}
else
{
JOptionPane.showMessageDialog(this,"WRONG");
}
}
catch (Exception e)
{
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(mainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(mainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(mainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(mainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new mainFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JLabel btnEnter;
private javax.swing.JComboBox<String> cbType;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JLabel lblExit;
private javax.swing.JLabel lblHeaderText;
private javax.swing.JLabel lblIcon;
private javax.swing.JLabel lblLoginTypeText;
private javax.swing.JLabel lblTopText;
private javax.swing.JPasswordField txtPassword;
private javax.swing.JTextField txtUsername;
// End of variables declaration
}
代码:DBConnection.java
import com.mysql.jdbc.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author sniper
*/
public class DBConnection {
private Connection DBConnection;
public Connection connect()
{
try
{
Class.forName("com.mysql.jdbc.Driver");
System.out.println("CONNECTION DONE!");
}
catch(ClassNotFoundException cnfe)
{
System.out.println("FAILED CONNECTION >> " + cnfe);
}
String url = "jdbc:derby://localhost:1527/JavaDB;create=true";
try{
DBConnection = (Connection) DriverManager.getConnection(url, "root", "toor");
System.out.println("Database Connected");
}
catch(SQLException se)
{
System.out.println("No Database >> " + se);
}
return DBConnection;
}
}
关于如何使其再次运行有什么建议吗?包括图像。
最佳答案
您正在连接到 Derby,并尝试将其转换为 com.mysql.jdbc.Connection
(这是 MySQL 驱动程序的一部分,而不是 Derby),这当然不会工作。将import com.mysql.jdbc.Connection
替换为import java.sql.Connection
,import com.mysql.jdbc.PreparedStatement
也是如此code>,将其替换为 import java.sql.PreparedStatement
。
您几乎不必强制转换为特定于驱动程序的类,而应始终尝试使用 JDBC API 接口(interface)。
关于java - 即使连接成功后,org.apache.derby.client.net.NetConnection40 也无法转换为 com.mysql.jdbc.Connection 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46513359/
COM 内存泄漏最常见的原因是什么? 我读过将初始化的 CComBSTR 的地址作为 [out] 参数传递给函数会导致泄漏。我正在寻找像这样枚举其他常见的编程错误。 最佳答案 未能为 COM 对象使用
在COM服务器执行过程中分配一 block 内存,然后通过一个输出参数将该内存块传递给客户端是很常见的。然后,客户端有义务使用 CoTaskMemFree() 等方法释放该内存。 问题是,这 bloc
我有一些 MFC 代码(自定义 CWnd 控件和一些要公开的类),我需要将它们制作成带有接口(interface)的 activex/COM 对象。使用 MFC 支持制作 ATL 项目并以这种方式制作
Devenv.com 是 visual studio 命令行界面,当您键入 devenv/? 时,devenv 的帮助会出现在控制台上。但是,如果没有任何选项,devenv.com 只会调用 deve
如何将 COM 接口(interface)的引用作为 COM 库中的参数传递? 这是示例: 1)客户端代码成功创建coclass并接收到pFunctionDiscovery中的接口(interface
我正在使用 django,我在 s3 中存储了诸如 imgs 之类的东西(为此我使用的是 boto),但最近我收到了这个错误: 'foo.bar.com.s3.amazonaws.com' doesn
我已经使用组件服务 MSC 对话框创建了一个 COM+ 应用程序。我将一个现有的 COM 对象导入到这个新的 COM+ 应用程序中。 我知道可以通过 COM+ 应用程序调用该 COM 对象。我可以简单
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 11 年前。 Improve thi
我正在使用通过 COM Interop 包装器公开的第三方 dll。但是,其中一个 COM 调用经常卡住(至少从不返回)。为了至少让我的代码更健壮一些,我异步包装了调用(_getDeviceInfoW
很多年前我读到有一个简单的 php 脚本可以将您的网站重定向到 http://example.com/google.com 到 google.com它适用于正斜杠右侧的任何域。我忘记了这个脚本是什么或
我正在实现我的第一个进程外 COM 服务器(我的第一个 COM 服务器,就此而言)。我已经按照步骤编写了一个 IDL 文件,为代理/ stub DLL 生成代码,编译 DLL,并注册它。 当我检查注册
是否可以在未知接口(interface)上增加 RCW 引用计数? (即不是底层 COM 对象的引用计数) 我有一些旧的 COM 服务器代码 int Method1(object comobject)
我注意到许多关于 COM 的书籍等都指出,在 COM 聚合中实现一个可用作内部对象的对象相对容易。但是,除非我遗漏了什么,否则聚合似乎只能在极其有限的场景中成功,因此只有在明确识别出这种场景时才应提供
假设我正在开发一个安装 COM 组件并安装程序注册它们的应用程序。这很好用。 现在该软件需要从内存棒上运行。如何注册我的库运行时并确保在运行应用程序后清理注册表? 最佳答案 您总是在 XP 或更高版本
我们已经使用Microsoft的ActiveX/COM(VB6)技术开发了一个软件系统。去年,我对自动化构建过程和整个SCM越来越感兴趣。我集中搜索了网络的大部分内容,以获取有关如何使用基于COM的软
我对 com 线程模型有点困惑。 我有一个 inproc 服务器,我想创建一个可从任何线程访问的接口(interface),而不管 CoInitializeEx 中使用的线程模型和/或标志。 当将接口
我的包以旁加载方式安装,并不断遇到特定于应用程序的权限错误。 是的,许多人建议在 regedit 和组件服务中手动更改权限和所有者。 我的应用实际上在组件服务(DCOMCNFG、DCOMCNFG -3
我正在使用第三方应用程序,并调用创建 的实例。我的 COM 对象。这个调用成功了,但是第三方应用程序上的函数没有返回指向创建对象的指针(我不知道为什么)。有没有办法获得指向我的对象的指针? 为了澄清,
我有一个用 C# 编写的托管 COM 对象和一个用 C++(MFC 和 ATL)编写的 native COM 客户端和接收器。客户端创建对象并在启动时向其事件接口(interface)提供建议,并在其
我的应用程序需要注册两个 COM DLL。如果用户有必要的访问权限,它会自动完成,否则可以使用 regsvr32 完成。 . 现在在一些工作站上会发生以下情况: 开始cmd.exe作为管理员 注册第一
我是一名优秀的程序员,十分优秀!