问题列表 - 第33433页

微软已知的DLL

HKML\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs

KnownDLL 的目的是什么?(为了更快地加载某些 Dll?)

如果我有管理员令牌,我就可以控制注册表值。
难道就没有安全漏洞吗?

微软为何支持该功能?

windows dll

10
推荐指数
2
解决办法
1万
查看次数

如果类继承自 2 个模板化父类,则调用不明确。为什么?

我有一个模板化类,它对作为模板参数给出的类执行操作。对于我的某些课程,我想将功能“分组”在一个课程中,以便调用者更轻松。事实上,代码看起来像这样(名称已更改):

template<typename T>
class DoSomeProcessing
{
public:
   process(T &t);
};

class ProcessingFrontEnd : public DoSomeProcessing<CustomerOrder>, public DoSomeProcessing<ProductionOrder>
{
};
Run Code Online (Sandbox Code Playgroud)

问题是,当我使用 CustomerOrder 作为参数调用 ProcessingFrontEnd::process 时,编译器会抱怨它。

我尝试在较小的测试应用程序中重现该问题。这是代码:

#include <vector>

class X : public std::vector<char>
        , public std::vector<void *>
{
};

int main(void)
{
X x;
x.push_back('c');
return 0;
}
Run Code Online (Sandbox Code Playgroud)

事实上,如果编译,微软的 VS2010 编译器会给出这个错误:

test.cpp
test.cpp(11) : error C2385: ambiguous access of 'push_back'
        could be the 'push_back' in base 'std::vector<char,std::allocator<char> >'
        or could be the 'push_back' in base 'std::vector<void *,std::allocator<void *> >'
test.cpp(11) : …
Run Code Online (Sandbox Code Playgroud)

c++ templates multiple-inheritance visual-c++-2010

5
推荐指数
1
解决办法
1746
查看次数

如何在不使用adb的情况下将数据内容复制到sdcard /?

嗨,我需要复制/移动内容data/tombstonessdcard/tombstones

我正在使用以下命令:

mv data/tombstones /sdcard/tombstones

"failed on 'tombstones' - Cross-device link"
Run Code Online (Sandbox Code Playgroud)

但我犯了错误.

android

25
推荐指数
1
解决办法
2万
查看次数

Java序列化 - 不兼容的serialVersionUID

我理解不兼容的serialVersionUID背后的理论(即你可以区分同一个类的不同编译版本),但我看到一个我不理解的问题,并没有陷入明显的错误原因(同一个类的不同编译版本) ).

我正在测试序列化/反序列化过程.所有代码都在同一个VM中的一台计算机上运行,​​并且序列化和反序列化方法都使用相同版本的编译类.序列化工作正常.被序列化的类非常复杂,包含许多其他类(java类型和UDT),并包含引用循环.我没有在任何课程中声明自己的UID.

这是代码:

public class Test {

    public static void main(String[] args) throws Exception {

        ContextNode context = WorkflowBuilder.getSimpleSequentialContextNode();
        String contextString = BinarySerialization.serializeToString(context);
        ContextNode contextD = BinarySerialization.deserializeFromString(ContextNode.class, contextString);
    }
}

public class BinarySerialization {

    public static synchronized String serializeToString(Object obj) throws Exception {
        ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(byteStream);
        oos.writeObject(obj);
        oos.close();
        return byteStream.toString();
    }

    public static synchronized <T> T deserializeFromString(Class<T> type, String byteString) throws Exception {
        T object = null;
        ByteArrayInputStream byteStream = new ByteArrayInputStream(byteString.getBytes()); …
Run Code Online (Sandbox Code Playgroud)

java serialization

4
推荐指数
1
解决办法
1888
查看次数

为什么printf在打印hex时只打印出一个字节?

pixel_datavectorchar.

当我这样做时,printf(" 0x%1x ", pixel_data[0] )我期待着看到0xf5.

但我觉得0xfffffff5我打印出一个4字节的整数而不是1字节.

为什么是这样?我给printf了一个char打印输出 - 它只有1个字节,为什么printf打印4?

NB.在printf实现包裹第三方API内,但只是想知道,这是标准的功能printf

c c++ printf

34
推荐指数
3
解决办法
4万
查看次数

如何保护基于C的库的init函数?

我已经编写了一个基于C的库,并且它可以并行地在多线程中工作,我在init函数中创建了一些全局互斥.

我希望在多线程中使用库API之前,在主线程中调用init函数.

但是,如果直接在多线程中调用init函数本身,那么这是一个问题.有没有办法保护我的库中的init函数本身?我能想到的一种方法是让应用程序创建一个互斥锁并保护对我的init函数的并行调用,但是我可以保护它免受我的库本身的影响吗?

c synchronization

2
推荐指数
1
解决办法
694
查看次数

ANTS Memory Profiler - 我应该关注哪个内存?

我的网站上有内存问题,我正试图找到它的底部.我已经下载了ANTS Memory Profiler的14天试用版,并一直在玩它以掌握它告诉我的内容.在时间轴上的内存选项,我可以看到Bytes in All HeapsPrivate Bytes等,但我不知道我应该注重哪些上看到内存尖峰和不回去了.

我正在使用ASP.NET 2.0剖析ASP.NET网站.

有人可以提供建议吗?

.net memory asp.net memory-leaks red-gate-ants

5
推荐指数
1
解决办法
888
查看次数

是否可以在Windows中对互斥锁进行静态初始化?

pthread支持使用PTHREAD_MUTEX_INITIALIZER静态初始化pthread_mutex_t.

是否有可能使用Windows互斥锁为互斥初始化实现类似的静态机制?

windows mutex pthreads

6
推荐指数
2
解决办法
2477
查看次数

如何使用RelativeLayout实现以下结果?

图片:http://img838.imageshack.us/img838/1402/picse.png

如何在Pic中进行布局.2仅使用RelativeLayout.下面是第一个屏幕截图的xml布局.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
<TextView
    android:id="@+id/timer_textview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:layout_marginTop="10dip"
    android:textSize="30sp"
    android:layout_alignParentTop="true"
    android:text="@string/timer_start" />

<ListView 
    android:id="@+id/questions_listview"
    android:layout_below="@id/timer_textview"  
    android:layout_width="wrap_content"
    android:layout_height="fill_parent" />

<Button android:id="@+id/true_btn"
    android:text="@string/true_option"
    android:layout_alignParentBottom="true"
    android:layout_weight="1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

<Button
    android:id="@+id/false_btn"
    android:text="@string/false_option"
    android:layout_toRightOf="@id/true_btn"
    android:layout_alignBaseline="@id/true_btn"
    android:layout_weight="1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

user-interface android relativelayout

7
推荐指数
1
解决办法
6154
查看次数

等待100毫秒,从方法返回的数据抛出异常

如何在时间范围内从方法或属性返回任何类型的数据,如果在该时间范围内返回任何数据,则抛出异常?

我有一个简单的方法来执行一个简单的任务,一旦执行该方法返回一个值,如果在100毫秒内返回任何值,我希望该方法被中止并抛出异常,例如TimeoutException,例如,任何类型的例外,只要它完成任务.

.net c# asynchronous timeout

3
推荐指数
2
解决办法
301
查看次数